瀏覽代碼

avoid creating a new bindings entry

Falko Schindler 2 年之前
父節點
當前提交
de55747283
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nicegui/binding.py

+ 1 - 1
nicegui/binding.py

@@ -30,7 +30,7 @@ def propagate(source_obj: Any, source_name: str, visited: Set[Tuple[int, str]] =
     if visited is None:
         visited = set()
     visited.add((id(source_obj), source_name))
-    for _, target_obj, target_name, transform in bindings[(id(source_obj), source_name)]:
+    for _, target_obj, target_name, transform in bindings.get((id(source_obj), source_name), []):
         if (id(target_obj), target_name) in visited:
             continue
         target_value = transform(getattr(source_obj, source_name))