Skip to content

Commit

Permalink
json state: add extra check for str key
Browse files Browse the repository at this point in the history
workaround for #37
  • Loading branch information
karlicoss committed Oct 19, 2022
1 parent e6ced6a commit 9c4fb4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/orger/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def get(self) -> State:
return self.state

def feed(self, key: str, value: Any, action: Callable[[], None]) -> None:
# just to be safe so we don't dump int by accident
assert isinstance(key, str), f"key/id has to be a str! key: {repr(key)}, value: {repr(value)}"

if key in self:
self.logger.debug(f'already handled: %s: %s', key, value)
return
Expand Down

0 comments on commit 9c4fb4b

Please sign in to comment.