Protection from fields that are None in Struct

This commit is contained in:
Doug Blank 2013-12-24 09:30:39 -05:00
parent ce07c7e15f
commit a050704299

View File

@ -475,7 +475,10 @@ class Struct(object):
"""
if hasattr(item, "classname") and self.db:
obj = self.db.get_from_name_and_handle(item.classname, str(item))
return Struct(obj.to_struct(), self.db)
if obj:
return Struct(obj.to_struct(), self.db)
else:
return None
else:
return item