Explorar o código

handle `undefined` in event args

Falko Schindler hai 1 ano
pai
achega
73f3837528
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      nicegui/nicegui.py

+ 1 - 1
nicegui/nicegui.py

@@ -173,7 +173,7 @@ def handle_event(client: Client, msg: Dict) -> None:
     with client:
         sender = client.elements.get(msg['id'])
         if sender:
-            msg['args'] = [json.loads(arg) for arg in msg.get('args', [])]
+            msg['args'] = [None if arg is None else json.loads(arg) for arg in msg.get('args', [])]
             if len(msg['args']) == 1:
                 msg['args'] = msg['args'][0]
             sender._handle_event(msg)