Reverted a NPE check to better support reflection method
This commit is contained in:
parent
03b49a5268
commit
d1a7a4fd63
1 changed files with 3 additions and 4 deletions
|
@ -13,11 +13,10 @@ namespace Kavita.Common
|
||||||
var json = File.ReadAllText(filePath);
|
var json = File.ReadAllText(filePath);
|
||||||
var jsonObj = JsonSerializer.Deserialize<dynamic>(json);
|
var jsonObj = JsonSerializer.Deserialize<dynamic>(json);
|
||||||
const string key = "TokenKey";
|
const string key = "TokenKey";
|
||||||
|
|
||||||
JsonElement? tokenElement = null;
|
if (jsonObj.TryGetProperty(key, out JsonElement tokenElement))
|
||||||
if (jsonObj?.TryGetProperty(key, out tokenElement))
|
|
||||||
{
|
{
|
||||||
return tokenElement?.GetString() != "super secret unguessable key";
|
return tokenElement.GetString() != "super secret unguessable key";
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue