From 35309b863c4fc16aa7bcdcb1b16e9ee489d9a3d0 Mon Sep 17 00:00:00 2001 From: kjac Date: Fri, 20 Jun 2014 10:56:29 +0200 Subject: [PATCH] Fixing the unit tests The call to DisposableTimer.DebugDuration() in ArchetypeValueConverter.ConvertDataToSource() expects the propertyType parameter to be not null, but the implementation of ArchetypeValueConverter.ConvertDataToSource() allows the propertyType parameter to be null. This breaks some of the unit tests. I've added a null check in the call to DisposableTimer.DebugDuration() to counter this issue. --- .../PropertyConverters/ArchetypeValueConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs b/app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs index 32f56cf..ad99f1c 100644 --- a/app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs +++ b/app/Umbraco/Umbraco.Archetype/PropertyConverters/ArchetypeValueConverter.cs @@ -34,7 +34,7 @@ namespace Archetype.PropertyConverters if (!sourceString.DetectIsJson()) return defaultValue; - using (var timer = DisposableTimer.DebugDuration(string.Format("ConvertDataToSource ({0})", propertyType.PropertyTypeAlias))) + using (var timer = DisposableTimer.DebugDuration(string.Format("ConvertDataToSource ({0})", propertyType != null ? propertyType.PropertyTypeAlias : "null"))) { var archetype = ArchetypeHelper.Instance.DeserializeJsonToArchetype(sourceString, (propertyType != null ? propertyType.DataTypeId : -1),