Avoid null pointers when race conditions or faults are present in protocol closing

Avoid some of the detected faults
This commit is contained in:
Camilo Alvarez
2019-02-06 17:53:05 -05:00
parent e1fc272e1c
commit cda557b6fb

View File

@@ -43,18 +43,18 @@ namespace mRemoteNG.UI.Tabs
}
else
{
((InterfaceControl)Tag).Protocol.Close();
((InterfaceControl)Tag)?.Protocol.Close();
}
}
else
{
// close without the confirmation prompt...
((InterfaceControl)Tag).Protocol.Close();
((InterfaceControl)Tag)?.Protocol.Close();
}
}
else
{
((InterfaceControl)Tag).Protocol.Close();
((InterfaceControl)Tag)?.Protocol.Close();
}
base.OnFormClosing(e);
}