From 6c163d1a4580b543f15ac13c61f9d0463f80c1a3 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Tue, 29 Jan 2019 19:01:03 -0600 Subject: [PATCH] Fix NRE when disconnecting --- Assets/Mirror/Runtime/ClientScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Mirror/Runtime/ClientScene.cs b/Assets/Mirror/Runtime/ClientScene.cs index 0e8fe8ef4..45514ded4 100644 --- a/Assets/Mirror/Runtime/ClientScene.cs +++ b/Assets/Mirror/Runtime/ClientScene.cs @@ -363,7 +363,7 @@ public static void DestroyAllClientObjects() foreach (KeyValuePair kvp in NetworkIdentity.spawned) { NetworkIdentity identity = kvp.Value; - if (identity.gameObject != null) + if (identity != null && identity.gameObject != null) { if (!InvokeUnSpawnHandler(identity.assetId, identity.gameObject)) {