fix: reject unsupported upstream matrix payloads per item
This commit is contained in:
@@ -8,7 +8,12 @@ public static class UpstreamValueMapping
|
||||
/// <summary>Materializes scalar and one-dimensional array values without flattening matrices.</summary>
|
||||
/// <param name="value">The upstream value.</param>
|
||||
/// <returns>The independent CLR payload.</returns>
|
||||
public static object? ToClr(Variant value) => Detach(value.AsBoxedObject(Variant.BoxingBehavior.Legacy));
|
||||
public static object? ToClr(Variant value)
|
||||
{
|
||||
if (value.TypeInfo.IsMatrix)
|
||||
throw new NotSupportedException("Matrix payloads are not supported by the OPC UA driver.");
|
||||
return Detach(value.AsBoxedObject(Variant.BoxingBehavior.Legacy));
|
||||
}
|
||||
|
||||
private static object? Detach(object? value) => value switch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user