From df164ee618b80e0a70bf23718a3731f185d2e844 Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Wed, 6 Mar 2013 08:02:09 -0100 Subject: [PATCH] Fixes U4-1835 by checking if the value is null before running the regex validation against the value. --- src/Umbraco.Core/Models/PropertyType.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Core/Models/PropertyType.cs b/src/Umbraco.Core/Models/PropertyType.cs index c67a2bd2ed..f9155f1894 100644 --- a/src/Umbraco.Core/Models/PropertyType.cs +++ b/src/Umbraco.Core/Models/PropertyType.cs @@ -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()); }