From 7205001ff39dab8bea2342eed4d6eec07fc81607 Mon Sep 17 00:00:00 2001 From: Jerrie Pelser Date: Wed, 19 Aug 2015 11:13:18 +0700 Subject: [PATCH] Remove C# 6 features --- .../Shopify/Provider/ShopifyAuthenticatedContext.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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