Explorar el Código

fix cancel type error in single `action()`

wangweimin hace 2 años
padre
commit
ac02518dea
Se han modificado 1 ficheros con 3 adiciones y 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]