Fixes U4-1835 by checking if the value is null before running the regex validation against the value.
This commit is contained in:
@@ -338,6 +338,9 @@ namespace Umbraco.Core.Models
|
||||
//Check against Regular Expression for Legacy DataTypes
|
||||
if(!string.IsNullOrEmpty(ValidationRegExp))
|
||||
{
|
||||
if (value == null)
|
||||
return false;
|
||||
|
||||
var regexPattern = new Regex(ValidationRegExp);
|
||||
return regexPattern.IsMatch(value.ToString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user