Commit 8e9f907a authored by Andreas Heine's avatar Andreas Heine

Update uatypes.py

parent 6083efb1
......@@ -750,7 +750,10 @@ class Variant(FrozenClass):
if self.VariantType is None:
self.VariantType = self._guess_type(self.Value)
if self.Value is None and not self.is_array and self.VariantType not in (VariantType.Null, VariantType.String, VariantType.DateTime, VariantType.ExtensionObject):
raise UaError(f"Non array Variant of type {self.VariantType} cannot have value None")
if self.Value == None and self.VariantType == VariantType.NodeId:
self.Value = NodeId(0,0)
else:
raise UaError(f"Non array Variant of type {self.VariantType} cannot have value None")
if self.Dimensions is None and isinstance(self.Value, (list, tuple)):
dims = get_shape(self.Value)
if len(dims) > 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment