From 928e74f24cff21890592b66603ee10129f6542e6 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 May 2016 17:14:13 +0200 Subject: [PATCH] No C# 6 yet --- .../Models/EntityBase/TracksChangesEntityBase.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 109084e9b9..43da67297f 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -54,7 +54,8 @@ namespace Umbraco.Core.Models.EntityBase _propertyChangedInfo[propertyInfo.Name] = true; - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name)); + if (PropertyChanged != null) + PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name)); } /// @@ -165,8 +166,8 @@ namespace Umbraco.Core.Models.EntityBase /// /// returns true if the value changed /// - /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we - /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set + /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we + /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set /// to the same value, so it's really not dirty. /// internal bool SetPropertyValueAndDetectChanges(Func setValue, T value, PropertyInfo propertySelector) @@ -193,8 +194,8 @@ namespace Umbraco.Core.Models.EntityBase /// The equality comparer to use /// returns true if the value changed /// - /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we - /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set + /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we + /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set /// to the same value, so it's really not dirty. /// internal bool SetPropertyValueAndDetectChanges(Func setValue, T value, PropertyInfo propertySelector, IEqualityComparer comparer)