form: fix pattern can be None

This commit is contained in:
axolotle 2023-12-02 17:24:42 +01:00
parent dad366da61
commit 878944c7c1

View file

@ -2095,6 +2095,7 @@ def prompt_or_validate_form(
if ( if (
isinstance(option, (BaseStringOption, TagsOption)) isinstance(option, (BaseStringOption, TagsOption))
and "regex" in err["type"] and "regex" in err["type"]
and option.pattern is not None
): ):
err_text = option.pattern.error err_text = option.pattern.error
else: else: