mirror of
https://github.com/netchx/netch.git
synced 2026-03-26 18:49:46 +08:00
ignore JsonSerializer.Deserialize return value possible null
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user