Fix Shopify parsing (#2530)

This commit is contained in:
Andrew Camilleri 2021-05-19 09:26:54 +02:00 committed by GitHub
parent 3b375929c1
commit 201b4d6ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,9 +25,17 @@ namespace BTCPayServer.Plugins.Shopify
public static ShopifySettings GetShopifySettings(this StoreBlob storeBlob)
{
if (storeBlob.AdditionalData.TryGetValue(StoreBlobKey, out var rawS) && rawS is JObject rawObj)
if (storeBlob.AdditionalData.TryGetValue(StoreBlobKey, out var rawS))
{
return new Serializer(null).ToObject<ShopifySettings>(rawObj);
if (rawS is JObject rawObj)
{
return new Serializer(null).ToObject<ShopifySettings>(rawObj);
}
else if( rawS.Type == JTokenType.String)
{
return new Serializer(null).ToObject<ShopifySettings>(rawS.Value<string>());
}
}
return null;