LPCconnector/LPCAppObject.py
changeset 34 b2fb188c9bff
parent 31 a9c9d1fc97d3
child 35 cb9da964a178
--- a/LPCconnector/LPCAppObject.py	Thu Mar 21 09:29:46 2013 +0900
+++ b/LPCconnector/LPCAppObject.py	Thu Mar 21 02:06:16 2013 +0100
@@ -46,7 +46,7 @@
 
     def GetPLCstatus(self):
         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
-        if len(strcounts) == LogLevelsCount * 4:
+        if strcounts is not None and len(strcounts) == LogLevelsCount * 4:
             cstrcounts = ctypes.create_string_buffer(strcounts)
             ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32))
             counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)]