Fixes U4-1835 by checking if the value is null before running the regex validation against the value.

This commit is contained in:
Morten Christensen
2013-03-06 08:02:09 -01:00
parent 21b0687a57
commit df164ee618

View File

@@ -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());
}