diff --git a/UaClient/ServiceModel/Ua/ExpandedNodeId.cs b/UaClient/ServiceModel/Ua/ExpandedNodeId.cs index b3f1414..5ab3bd5 100644 --- a/UaClient/ServiceModel/Ua/ExpandedNodeId.cs +++ b/UaClient/ServiceModel/Ua/ExpandedNodeId.cs @@ -196,7 +196,7 @@ public override int GetHashCode() { int hashCode = -641591048; hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(NodeId); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(NamespaceUri); + if (NamespaceUri != null) hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(NamespaceUri); hashCode = hashCode * -1521134295 + ServerIndex.GetHashCode(); return hashCode; } diff --git a/UaClient/ServiceModel/Ua/LocalizedText.cs b/UaClient/ServiceModel/Ua/LocalizedText.cs index a07c459..5f377a9 100644 --- a/UaClient/ServiceModel/Ua/LocalizedText.cs +++ b/UaClient/ServiceModel/Ua/LocalizedText.cs @@ -50,8 +50,8 @@ public bool Equals(LocalizedText? other) public override int GetHashCode() { int hashCode = 670029253; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Text); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Locale); + if (Text != null) hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Text); + if (Locale != null) hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Locale); return hashCode; } diff --git a/UaClient/ServiceModel/Ua/QualifiedName.cs b/UaClient/ServiceModel/Ua/QualifiedName.cs index ce8cf01..b39a668 100644 --- a/UaClient/ServiceModel/Ua/QualifiedName.cs +++ b/UaClient/ServiceModel/Ua/QualifiedName.cs @@ -79,7 +79,7 @@ public bool Equals(QualifiedName? other) public override int GetHashCode() { int hashCode = 978021522; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name); + if (Name != null) hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + NamespaceIndex.GetHashCode(); return hashCode; }