ignore JsonSerializer.Deserialize return value possible null

This commit is contained in:
ChsBuffer
2021-03-05 00:22:57 +08:00
parent 7265bd2922
commit 1ea0bb4096
3 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ namespace Netch.Servers.Shadowsocks
public IEnumerable<Server> ParseSsdUri(string s)
{
var json = JsonSerializer.Deserialize<Main>(ShareLink.URLSafeBase64Decode(s.Substring(6)));
var json = JsonSerializer.Deserialize<Main>(ShareLink.URLSafeBase64Decode(s.Substring(6)))!;
return json.servers.Select(server => new Shadowsocks
{

View File

@@ -97,7 +97,7 @@ namespace Netch.Servers.VMess
if (data.TransferProtocol == "quic")
{
if (VMessGlobal.QUIC.Contains(vmess.host))
if (VMessGlobal.QUIC.Contains(vmess.host!))
{
data.QUICSecure = vmess.host;
data.QUICSecret = vmess.path;

View File

@@ -57,7 +57,7 @@ namespace Netch.Utils
break;
}
var dictionary = JsonSerializer.Deserialize<Dictionary<string, string>>(text);
var dictionary = JsonSerializer.Deserialize<Dictionary<string, string>>(text)!;
if (!dictionary.Any())
{