From 6a0ca68d173a90ab80cd3ed6935f326d0ebc3c29 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 May 2016 18:44:22 +0200 Subject: [PATCH] Fixing, stupid --- .../Models/EntityBase/TracksChangesEntityBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 43da67297f..7e93c8cef2 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -93,7 +93,7 @@ namespace Umbraco.Core.Models.EntityBase /// True if Property was changed, otherwise False. Returns false if the entity had not been previously changed. public virtual bool WasPropertyDirty(string propertyName) { - return WasDirty() && _lastPropertyChangedInfo.Any(x => x.Key == propertyName); + return WasDirty() && _lastPropertyChangedInfo!= null && _lastPropertyChangedInfo.Any(x => x.Key == propertyName); } /// @@ -133,7 +133,9 @@ namespace Umbraco.Core.Models.EntityBase if (rememberPreviouslyChangedProperties) { //copy the changed properties to the last changed properties - _lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value); + _lastPropertyChangedInfo = _propertyChangedInfo == null + ? null + : _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value); } //NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME