-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Hello
I am getting null reference exception when using the latest 0.5.5 version.
I did some digging and perhaps this might be the culprit? As attrib.value is value which is already checked to be null in the preceeding condition and then passed in to the IsAttributeValidForOperation method that tries to access the values. Perhaps it was meant to be attributeInfo that was supposed to be sent in?
Apologies if I'm wrong here, just tried to save you some time with debugging.
PowerPlatform-DataverseServiceClient/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs
Lines 489 to 493 in ba545dc
| foreach (var attrib in entityAttributes) | |
| { | |
| var keyValuePair = attrib; | |
| var value = keyValuePair.Value; | |
| var key = keyValuePair.Key; |
PowerPlatform-DataverseServiceClient/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs
Lines 631 to 635 in ba545dc
| else if (value is null) | |
| { | |
| var attributeInfo = mUtil.GetAttributeMetadata(sourceEntity.LogicalName, key.ToLower()); | |
| if (!IsAttributeValidForOperation((AttributeMetadata)attrib.Value, requestedMethod)) |
PowerPlatform-DataverseServiceClient/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs
Lines 676 to 682 in ba545dc
| private static bool IsAttributeValidForOperation(AttributeMetadata attrib, HttpMethod requestedMethod) | |
| { | |
| switch (requestedMethod.ToString().ToLowerInvariant()) | |
| { | |
| case "post": | |
| case "put": | |
| if (attrib.IsValidForCreate.HasValue && !attrib.IsValidForCreate.Value) |
