mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Fixing JSON converter error when handling default existing value with struct types
This commit is contained in:
parent
cbf7a3d79c
commit
9ad49540d2
1 changed files with 4 additions and 1 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue