From f431d53c895c19d6c8fe2a01fcb354605ac4eed4 Mon Sep 17 00:00:00 2001 From: romanett Date: Wed, 11 Dec 2024 08:48:09 +0100 Subject: [PATCH] Fix Null reference Exception in NodeState for AccessRestrictions (#2894) * fix cast that throws when Enum is null --- Stack/Opc.Ua.Core/Stack/State/NodeState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stack/Opc.Ua.Core/Stack/State/NodeState.cs b/Stack/Opc.Ua.Core/Stack/State/NodeState.cs index ef96146731..f92b26afc2 100644 --- a/Stack/Opc.Ua.Core/Stack/State/NodeState.cs +++ b/Stack/Opc.Ua.Core/Stack/State/NodeState.cs @@ -3667,7 +3667,7 @@ namespace Opc.Ua result = onReadAccessRestrictions(context, this, ref accessRestrictions); } - if (ServiceResult.IsGood(result)) + if (ServiceResult.IsGood(result) && accessRestrictions != null) { value = (ushort)accessRestrictions; }