Skip to content

Commit

Permalink
Fix another potential bug concerning UserData object with no data in …
Browse files Browse the repository at this point in the history
…them

There are no calls to UserData.__call__ that also pass a value for  that I can find.
But if someone were to do this, it would suffer from the same bug: a UserData instance with no data in it would evaluate to False
and thus the  would be used, which I thik is not what is intended when there is a reference UserData passed explicitly
  • Loading branch information
LoyVanBeek committed Feb 13, 2023
1 parent dc98890 commit 653dc7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flexbe_core/src/flexbe_core/core/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __setattr__(self, key, value):
self[key] = value

def __call__(self, reference=None, add_from=None, update_from=None, remove_key=None):
self._reference = reference or self._reference
self._reference = reference if reference is not None else self._reference
if isinstance(add_from, UserData):
for key, value in add_from._data.items():
if key not in self._data:
Expand Down

0 comments on commit 653dc7e

Please sign in to comment.