Explorar o código

fix cancel type error in single `action()`

wangweimin %!s(int64=2) %!d(string=hai) anos
pai
achega
1af01efe57
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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]