diff --git a/Owin.Security.Providers/Shopify/Provider/ShopifyAuthenticatedContext.cs b/Owin.Security.Providers/Shopify/Provider/ShopifyAuthenticatedContext.cs index c3ff120..2bc6b35 100644 --- a/Owin.Security.Providers/Shopify/Provider/ShopifyAuthenticatedContext.cs +++ b/Owin.Security.Providers/Shopify/Provider/ShopifyAuthenticatedContext.cs @@ -71,8 +71,15 @@ private static string TryGetValue(JToken shop, string propertyName) { - var propertyValue = shop?.First?.First?[propertyName]; - return propertyValue?.ToString(); + if (shop != null && shop.First != null && shop.First.First != null) + { + var propertyValue = shop.First.First[propertyName]; + + if (propertyValue != null) + return propertyValue.ToString(); + } + + return null; } } } \ No newline at end of file