Skip to content

Commit

Permalink
Fix incorrect detection of possibly empty array fields
Browse files Browse the repository at this point in the history
Ref. #375
  • Loading branch information
treiher committed Jul 29, 2020
1 parent 29bbe35 commit f3e1d12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rflx/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,8 @@ def is_possibly_empty(self, field: Field) -> bool:
return False

for p in self._state.paths[FINAL]:
if not any(l.target == field for l in p):
continue
conditions = [l.condition for l in p if l.condition != TRUE]
lengths = [Equal(Length(l.target.name), l.length) for l in p if l.length != UNDEFINED]
empty_field = Equal(Length(field.name), Number(0))
Expand Down

0 comments on commit f3e1d12

Please sign in to comment.