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;