From d1a7a4fd635d512707bfb259cc0a473273170f3d Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Fri, 14 May 2021 08:17:57 -0500 Subject: [PATCH] Reverted a NPE check to better support reflection method --- Kavita.Common/Configuration.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Kavita.Common/Configuration.cs b/Kavita.Common/Configuration.cs index 5503e5dc1..02a01c9d8 100644 --- a/Kavita.Common/Configuration.cs +++ b/Kavita.Common/Configuration.cs @@ -13,11 +13,10 @@ namespace Kavita.Common var json = File.ReadAllText(filePath); var jsonObj = JsonSerializer.Deserialize(json); const string key = "TokenKey"; - - JsonElement? tokenElement = null; - if (jsonObj?.TryGetProperty(key, out tokenElement)) + + if (jsonObj.TryGetProperty(key, out JsonElement tokenElement)) { - return tokenElement?.GetString() != "super secret unguessable key"; + return tokenElement.GetString() != "super secret unguessable key"; } return false;