Bug on Concise DCF edit dialog value generating fixed
authorlbessard
Wed, 23 Jul 2008 18:02:27 +0200
changeset 500 13fcb9328a02
parent 499 061f12bd838b
child 501 9bec3864a891
Bug on Concise DCF edit dialog value generating fixed
objdictgen/commondialogs.py
--- a/objdictgen/commondialogs.py	Tue Jul 22 23:48:48 2008 +0200
+++ b/objdictgen/commondialogs.py	Wed Jul 23 18:02:27 2008 +0200
@@ -1565,13 +1565,15 @@
         self.RefreshValues()
     
     def GetValues(self):
-        value = LE_to_BE(len(self.Values), 4)
-        for row in self.Values:
-            value += LE_to_BE(row["Index"], 2)
-            value += LE_to_BE(row["Subindex"], 1)
-            value += LE_to_BE(row["Size"], 4)
-            value += LE_to_BE(row["Value"], row["Size"])
-        return value
+        if len(self.Values) > 0:
+            value = LE_to_BE(len(self.Values), 4)
+            for row in self.Values:
+                value += LE_to_BE(row["Index"], 2)
+                value += LE_to_BE(row["Subindex"], 1)
+                value += LE_to_BE(row["Size"], 4)
+                value += LE_to_BE(row["Value"], row["Size"])
+            return value
+        return ""
     
     def RefreshValues(self):
         if len(self.Table.data) > 0: