Skip to content

Commit

Permalink
Added null check to structureType.DefaultEncodingId (#1571)
Browse files Browse the repository at this point in the history
Added null check to structureType.DefaultEncodingId in the ReadNonValueAttribute method
  • Loading branch information
mrsuciu committed Nov 2, 2021
1 parent 0915063 commit f090f61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Stack/Opc.Ua.Core/Stack/State/DataTypeState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public override void Update(ISystemContext context, BinaryDecoder decoder, Attri
if (ServiceResult.IsGood(result))
{
if (dataTypeDefinition?.Body is StructureDefinition structureType &&
structureType.DefaultEncodingId.IsNullNodeId)
(structureType.DefaultEncodingId == null ||
structureType.DefaultEncodingId.IsNullNodeId))
{
// one time set the id for binary encoding, currently the only supported encoding
structureType.SetDefaultEncodingId(context, NodeId, null);
Expand Down

0 comments on commit f090f61

Please sign in to comment.