Fix nullable error

This commit is contained in:
Timothy Baldridge 2020-04-10 16:35:35 -06:00
parent 0830480821
commit c8120adf8b

View File

@ -78,7 +78,10 @@ namespace Wabbajack.Common
using var tr = new StreamReader(stream, Encoding.UTF8, leaveOpen: true);
using var reader = new JsonTextReader(tr);
var ser = JsonSerializer.Create(JsonSettings);
return ser.Deserialize<T>(reader);
var result = ser.Deserialize<T>(reader);
if (result == null)
throw new JsonException("Type deserialized into null");
return result;
}