Utils.Clone() bug (#249)

Steps to reproduce:
Create a variable instance of DataType = Opc.Ua.TimeZoneDataType
Read the variable

Actual result:
Opc.Ua.Utils.Clone() throws exception because the cast to Opc.Ua.TimeZoneDataType is not supported.

Expected result:
Variable instance of DataType = Opc.Ua.TimeZoneDataType can be read.
This commit is contained in:
Alexandru Dicu
2017-09-25 10:36:24 +02:00
committed by Erich Barnstedt
parent ce426ae089
commit 34bb611958
+9 -1
View File
@@ -1731,7 +1731,15 @@ namespace Opc.Ua
{
return castedObject.MemberwiseClone();
}
}
}
// copy Opc.Ua.TimeZoneDataType
{
TimeZoneDataType castedObject = value as TimeZoneDataType;
if (castedObject != null)
{
return castedObject.MemberwiseClone();
}
}
// don't know how to clone object.
throw new NotSupportedException(Utils.Format("Don't know how to clone objects of type '{0}'", type.FullName));