diff --git a/src/GWallet.Backend/Marshalling.fs b/src/GWallet.Backend/Marshalling.fs index 66186166a..c15bb5ad4 100644 --- a/src/GWallet.Backend/Marshalling.fs +++ b/src/GWallet.Backend/Marshalling.fs @@ -87,8 +87,10 @@ module Marshalling = let private currentVersion = VersionHelper.CURRENT_VERSION let ExtractType(json: string): Type = - let fullTypeName = (JsonConvert.DeserializeObject> json).TypeName - Type.GetType(fullTypeName) + let wrapper = JsonConvert.DeserializeObject> json + if Object.ReferenceEquals(null, wrapper) then + failwith <| SPrintF1 "Failed to extract type from JSON: %s" json + Type.GetType wrapper.TypeName let DeserializeCustom<'T>(json: string, settings: JsonSerializerSettings): 'T = if (json = null) then