Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Reverted a NPE check to better support reflection method

Joseph Milazzod1a7a4fd635d
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<dynamic>(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;