File tree Expand file tree Collapse file tree
src/EventLogExpert.Eventing/EventProviderDatabase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,11 +33,13 @@ public static T ConvertFromCompressedJson(byte[] value)
3333 using GZipStream gZipStream = new ( memoryStream , CompressionMode . Decompress ) ;
3434 using StreamReader streamReader = new ( gZipStream ) ;
3535
36- return JsonSerializer . Deserialize < T > ( streamReader . ReadToEnd ( ) ) ! ;
36+ return JsonSerializer . Deserialize < T > ( streamReader . ReadToEnd ( ) )
37+ ?? throw new JsonException ( $ "Failed to deserialize compressed JSON to type { typeof ( T ) . Name } . The deserialized value was null.") ;
3738 }
3839
3940 private static T ConvertFromJson ( string value )
4041 {
41- return JsonSerializer . Deserialize < T > ( value ) ! ;
42+ return JsonSerializer . Deserialize < T > ( value )
43+ ?? throw new JsonException ( $ "Failed to deserialize JSON to type { typeof ( T ) . Name } . The deserialized value was null.") ;
4244 }
4345}
You can’t perform that action at this time.
0 commit comments