瀏覽代碼

fix cancel type error in single `action()`

wangweimin 2 年之前
父節點
當前提交
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]