Browse Source

protect against possibly-missing STBlob32

David Rose 22 years ago
parent
commit
f8d1734379

+ 1 - 1
direct/src/extensions/Datagram-extensions.py

@@ -25,7 +25,7 @@
                 self.addString(arg)
             elif subatomicType == DCSubatomicType.STBlob:
                 self.addString(arg)
-            elif subatomicType == DCSubatomicType.STBlob32:
+            elif hasattr(DCSubatomicType, "STBlob32") and subatomicType == DCSubatomicType.STBlob32:
                 self.addString32(arg)
             elif subatomicType == DCSubatomicType.STInt8array:
                 self.addUint16(len(arg))

+ 1 - 1
direct/src/extensions/DatagramIterator-extensions.py

@@ -26,7 +26,7 @@
                 retVal = self.getString()
             elif subatomicType == DCSubatomicType.STBlob:
                 retVal = self.getString()
-            elif subatomicType == DCSubatomicType.STBlob32:
+            elif hasattr(DCSubatomicType, "STBlob32") and subatomicType == DCSubatomicType.STBlob32:
                 retVal = self.getString32()
             elif subatomicType == DCSubatomicType.STInt8array:
                 len = self.getUint16()