We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b8b88d commit 17a594eCopy full SHA for 17a594e
MLAPI/NetworkingManagerComponents/Core/SpawnManager.cs
@@ -77,10 +77,13 @@ internal static void DestroySceneObjects()
77
78
internal static void DestroyNonSceneObjects()
79
{
80
- foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
+ if(spawnedObjects != null)
81
82
- if (!netObject.Value.sceneObject)
83
- MonoBehaviour.Destroy(netObject.Value.gameObject);
+ foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
+ {
84
+ if (!netObject.Value.sceneObject)
85
+ MonoBehaviour.Destroy(netObject.Value.gameObject);
86
+ }
87
}
88
89
0 commit comments