Skip to content

Commit

Permalink
Fix nullable object access in NodeState.AccessRestrictions.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnstee committed Jul 9, 2024
1 parent ab84ec2 commit 2e252ef
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static Task<List<NodeSetModel>> LoadNodeSetAsync(IOpcUaContext opcContext
}
}
}

// Ensure references that are implicitly used by the importer get resolved into the OPC model
ReferenceTypeModelFactoryOpc.Create(opcContext, opcContext.GetNode(ReferenceTypes.HasSubtype), null, out _);
ReferenceTypeModelFactoryOpc.Create(opcContext, opcContext.GetNode(ReferenceTypes.HasModellingRule), null, out _);
Expand Down Expand Up @@ -789,7 +789,7 @@ public static List<BaseTypeState> GetBaseTypes(IOpcUaContext opcContext, BaseTyp
}
else if (nodeModel is MethodModel method)
{
nodesetModel.Methods.Add(method);
nodesetModel.Methods.Add(method);
}
else if (nodeModel is ReferenceTypeModel referenceType)
{
Expand Down Expand Up @@ -938,7 +938,7 @@ protected override void Initialize(IOpcUaContext opcContext, NodeState opcNode,
InitializeDataTypeInfo(_model, opcContext, variableNode, recursionDepth);
if (variableNode.AccessLevelEx != 1) _model.AccessLevel = variableNode.AccessLevelEx;
// deprecated if (variableNode.UserAccessLevel != 1) _model.UserAccessLevel = variableNode.UserAccessLevel;
if (variableNode.AccessRestrictions != 0) _model.AccessRestrictions = (ushort)variableNode.AccessRestrictions;
if (variableNode.AccessRestrictions.HasValue && (variableNode.AccessRestrictions != 0)) _model.AccessRestrictions = (ushort)variableNode.AccessRestrictions;
if (variableNode.WriteMask != 0) _model.WriteMask = (uint)variableNode.WriteMask;
if (variableNode.UserWriteMask != 0) _model.UserWriteMask = (uint)variableNode.UserWriteMask;
if (variableNode.MinimumSamplingInterval != 0)
Expand Down Expand Up @@ -1105,7 +1105,7 @@ private void ProcessMethodArguments(MethodModel methodModel, string browseName,
}
}
}

//if (argumentVariable.OtherReferencedNodes?.Any() != true && argumentVariable.OtherReferencingNodes?.Any() != true)
//{
// var argumentProperty = NodeModelOpcExtensions.GetArgumentProperty(methodModel, browseName, modelArguments, opcContext);
Expand Down

0 comments on commit 2e252ef

Please sign in to comment.