mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-10 18:24:53 +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)
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user