Avoid null refs

This commit is contained in:
Cinder
2021-12-09 11:59:30 -06:00
parent e0e2267838
commit eec209d8b8
10 changed files with 68 additions and 64 deletions

View File

@@ -174,7 +174,7 @@ namespace GridProxy
if (values.Contains("inventory-root"))
{
inventoryRoot = new UUID(
(string)((System.Collections.Hashtable)(((System.Collections.ArrayList)values["inventory-root"])[0]))["folder_id"]
(string)((System.Collections.Hashtable)(((System.Collections.ArrayList)values["inventory-root"])[0]))?["folder_id"]
);
if (logLogin)
{

View File

@@ -163,7 +163,7 @@ namespace VoiceTest
catch(Exception e)
{
Console.WriteLine(e.Message);
if (e is VoiceException exception && exception.LoggedIn)
if (e is VoiceException { LoggedIn: true } exception)
{
client.Network.Logout();
}