Browse Source

fix cancel type error in single `action()`

wangweimin 2 năm trước cách đây
mục cha
commit
ac02518dea
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      pywebio/io_ctrl.py

+ 3 - 0
pywebio/io_ctrl.py

@@ -261,6 +261,9 @@ def single_input(item_spec, valid_func, preprocess_func, onchange_func):
                                preprocess_funcs={name: preprocess_func},
                                item_valid_funcs={name: valid_func},
                                onchange_funcs={name: onchange_func})
+
+    if not data:  # form cancel
+        return None
     return data[name]