Skip to content

Commit

Permalink
auditor deletes entities in OBJECTS section without owner handle #1240
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Feb 11, 2025
1 parent 0457e09 commit f51d63f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ezdxf/sections/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,14 @@ def audit_objects(self):
current_db_size = len(auditor.entitydb)

for entity in self.objects:
if not entity.dxf.hasattr("owner"):
# check_owner_exist() ignores entities without owner handle
auditor.fixed_error(
code=AuditError.INVALID_OWNER_HANDLE,
message=f"Deleted {str(entity)} entity without owner handle.",
)
auditor.trash(entity)
continue
auditor.check_owner_exist(entity)
entity.audit(auditor)

Expand Down

0 comments on commit f51d63f

Please sign in to comment.