Skip to content

Commit

Permalink
Fixing #2013
Browse files Browse the repository at this point in the history
Additional safeguard when field is being deleted via `page.delete_widget()`:
In this case, the underlying annotation may not have been re-established (attribute "_annot"), which will there for be checked.
  • Loading branch information
JorjMcKie authored and jamie-lemon committed Dec 12, 2022
1 parent 167f3d6 commit 3cf9dae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fitz/helper-fields.i
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,7 @@ class Widget(object):
return "'%s' widget on %s" % (self.field_type_string, str(self.parent))

def __del__(self):
annot = getattr(self, "_annot")
if annot:
if hasattr(self, "_annot"):
del self._annot

@property
Expand Down

0 comments on commit 3cf9dae

Please sign in to comment.