Skip to content

Null Reference Exception version 0.5.5 #175

@Garbageous

Description

@Garbageous

Hello

I am getting null reference exception when using the latest 0.5.5 version.

image

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.

foreach (var attrib in entityAttributes)
{
var keyValuePair = attrib;
var value = keyValuePair.Value;
var key = keyValuePair.Key;

else if (value is null)
{
var attributeInfo = mUtil.GetAttributeMetadata(sourceEntity.LogicalName, key.ToLower());
if (!IsAttributeValidForOperation((AttributeMetadata)attrib.Value, requestedMethod))

private static bool IsAttributeValidForOperation(AttributeMetadata attrib, HttpMethod requestedMethod)
{
switch (requestedMethod.ToString().ToLowerInvariant())
{
case "post":
case "put":
if (attrib.IsValidForCreate.HasValue && !attrib.IsValidForCreate.Value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions