get_required_dict() crashed at invalid handles
@@ -209,6 +209,9 @@ class DXFDictionary(DXFObject):
dict_handle = self.get(key)
except DXFKeyError:
dxf_dict = self.add_new_dict(key)
+ else:
+ if dict_handle not in self.entitydb: # invalid handle
+ dxf_dict = self.add_new_dict(key)
else:
dxf_dict = self.dxffactory.wrap_handle(dict_handle)
return dxf_dict
