mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
fix: Fixing JSON converter error when handling default existing value with struct types
This commit is contained in:
@@ -103,7 +103,10 @@ namespace ICD.Common.Utils.Json
|
|||||||
if (serializer == null)
|
if (serializer == null)
|
||||||
throw new ArgumentNullException("serializer");
|
throw new ArgumentNullException("serializer");
|
||||||
|
|
||||||
return ReadJson(reader, (T)existingValue, serializer);
|
// Casting null blows up struct casts
|
||||||
|
T cast = (T)(existingValue ?? default(T));
|
||||||
|
|
||||||
|
return ReadJson(reader, cast, serializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user