mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
refactor: prevent NRE
This commit is contained in:
committed by
alexiscatnip
parent
9b6bf20fab
commit
23224cefbe
@@ -36,9 +36,10 @@ namespace Raindrop.UI.LoadingScreen
|
||||
|
||||
private void RemoveLoginEvents()
|
||||
{
|
||||
if (netcom == null)
|
||||
return;
|
||||
netcom.ClientLoggingIn -= new EventHandler<OverrideEventArgs>(netcom_ClientLoggingIn);
|
||||
netcom.ClientLoginStatus -= new EventHandler<LoginProgressEventArgs>(netcom_ClientLoginStatus);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ namespace Raindrop.UI.map.Map_SceneHierachy
|
||||
Client.Grid.GridRegion -= new EventHandler<GridRegionEventArgs>(Grid_GridRegion);
|
||||
Client.Grid.GridLayer -= new EventHandler<GridLayerEventArgs>(Grid_GridLayer);
|
||||
|
||||
if (Instance == null) return;
|
||||
Instance.Netcom.ClientConnected -= NetcomOnClientConnected;
|
||||
Instance.Netcom.ClientDisconnected -= NetcomOnClientDisconnected;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user