mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Reverted a NPE check to better support reflection method
This commit is contained in:
parent
03b49a5268
commit
d1a7a4fd63
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user