Skip to content

Commit

Permalink
fix(domain): Test against js string undefined and null
Browse files Browse the repository at this point in the history
Prevent invalid domain lookup

fix #12
  • Loading branch information
jourdain committed Dec 20, 2022
1 parent bfaef3d commit 8fc0490
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions trame_simput/module/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,10 @@ def push(self, id=None, type=None, domains=None):
if type:
self._server.protocol_call("simput.ui.get", self._ui_manager.id, type)

try:
if domains: # removing int requirement, may have unknown effects
self._server.protocol_call(
"simput.domains.get", self._ui_manager.id, domains
)
except ValueError:
# Invalid domain so just skip it...
pass
if domains and domains not in ["undefined", "null"]:
self._server.protocol_call(
"simput.domains.get", self._ui_manager.id, domains
)

def emit(self, topic, **kwargs):
logger.info("emit: %s", topic)
Expand Down

0 comments on commit 8fc0490

Please sign in to comment.