From 8f3e3adea7c66208bf4afa885876db27c5ca8362 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 6 Sep 2018 15:42:23 +0000 Subject: [PATCH] --- server/AyaNova/biz/ValidateJsonPatch.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/AyaNova/biz/ValidateJsonPatch.cs b/server/AyaNova/biz/ValidateJsonPatch.cs index abb58556..ea60f04f 100644 --- a/server/AyaNova/biz/ValidateJsonPatch.cs +++ b/server/AyaNova/biz/ValidateJsonPatch.cs @@ -30,14 +30,15 @@ namespace AyaNova.Biz ProtectedProperties = protectedProperties.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); } - foreach (string Property in ProtectedProperties) - { - if (objectPatch.Operations.Any(m => m.path == $"/{Property.ToLowerInvariant()}")) + if (ProtectedProperties != null) + foreach (string Property in ProtectedProperties) { - biz.AddError(ValidationErrorType.NotChangeable, Property); - IsValid = false; + if (objectPatch.Operations.Any(m => m.path == $"/{Property.ToLowerInvariant()}")) + { + biz.AddError(ValidationErrorType.NotChangeable, Property); + IsValid = false; + } } - } //check for in-valid patches if (objectPatch.Operations.Any(m => m.path == "/id"))