1
0
Эх сурвалжийг харах

fix cancel type error in single `action()`

wangweimin 2 жил өмнө
parent
commit
ac02518dea
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  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]