mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Do not match pattern against empty value
This commit is contained in:
parent
962b78329f
commit
906a416f59
1 changed files with 1 additions and 1 deletions
|
@ -142,7 +142,7 @@ class PatternParameter(_ExtraParameter):
|
|||
def __call__(self, arguments, arg_name, arg_value):
|
||||
pattern, message = (arguments[0], arguments[1])
|
||||
|
||||
if not re.match(pattern, arg_value or ''):
|
||||
if arg_value and not re.match(pattern, arg_value or ''):
|
||||
raise MoulinetteError(errno.EINVAL, message)
|
||||
return arg_value
|
||||
|
||||
|
|
Loading…
Reference in a new issue