plcopen/structures.py
changeset 98 ec5d7af033d8
parent 93 c3c24b979a4d
child 99 2b18a72dcaf0
--- a/plcopen/structures.py	Wed Sep 19 13:32:24 2007 +0200
+++ b/plcopen/structures.py	Wed Sep 19 15:20:59 2007 +0200
@@ -262,7 +262,9 @@
 """
 
 def IsOfType(test, reference):
-    while test != None:
+    if reference is None:
+        return True
+    while test is not None:
         if test == reference:
             return True
         test = TypeHierarchy[test]
@@ -272,7 +274,7 @@
 returns list of all types that correspont to the ANY* meta type
 """
 def GetSubTypes(reference):
-    return [ typename for typename, parenttype in TypeHierarchy_list if typename[:3] != "ANY" and IsOfType(typename, reference)]
+    return [typename for typename, parenttype in TypeHierarchy_list if typename[:3] != "ANY" and IsOfType(typename, reference)]
 
 
 #-------------------------------------------------------------------------------