diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 3dc9bb974..65bb0a307 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -99,7 +99,11 @@ public static Action OnErrorEvent /// Shuts down the server and disconnects all clients // RuntimeInitializeOnLoadMethod -> fast playmode without domain reload [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] - public static void Shutdown() => NetworkServerComponent.singleton.Shutdown(); + public static void Shutdown() + { + if (NetworkServerComponent.singleton != null) + NetworkServerComponent.singleton.Shutdown(); + } // connections ///////////////////////////////////////////////////////// /// Add a connection and setup callbacks. Returns true if not added yet.