Skip to content

Commit

Permalink
Fix following of Falsy elements in get_children
Browse files Browse the repository at this point in the history
The problem can arise if user classes are used which can evaluate to `False` in
boolean contexts.
  • Loading branch information
igordejanovic committed Oct 22, 2020
1 parent 8a4e79b commit 63370cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ please take a look at related PRs and issues and see if the change affects you.

### Fixed

- Fixed bug with Falsy user classes in `get_children` ([#288])
- Fixed bug with unhashable objects during dot export ([#283])
- Fixed bug where (Ext)RelativeName scope providers accepted any referenced
object that contained the lookup name in its name. Thanks ipa-mdl@GitHub
Expand Down Expand Up @@ -496,6 +497,7 @@ please take a look at related PRs and issues and see if the change affects you.
- Export to dot.


[#288]: https://github.com/textX/textX/pull/288
[#284]: https://github.com/textX/textX/pull/284
[#283]: https://github.com/textX/textX/pull/283
[#282]: https://github.com/textX/textX/pull/282
Expand Down
2 changes: 1 addition & 1 deletion textx/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def follow(elem):
if attr.cont:
if attr.mult in (MULT_ONE, MULT_OPTIONAL):
new_elem = getattr(elem, attr_name)
if new_elem and should_follow(new_elem):
if new_elem is not None and should_follow(new_elem):
follow(new_elem)
else:
new_elem_list = getattr(elem, attr_name)
Expand Down

0 comments on commit 63370cd

Please sign in to comment.