Protection from fields that are None in Struct
This commit is contained in:
parent
ce07c7e15f
commit
a050704299
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user