diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index e586c49a9..3424c63bb 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1407,6 +1407,9 @@ class Server{ * @return Server */ public static function getInstance() : Server{ + if(self::$instance === null){ + throw new \RuntimeException("Attempt to retrieve Server instance outside server thread"); + } return self::$instance; }