Fix client crashing when connecting to server
authorest31 <MTest31@outlook.com>
Tue, 29 Dec 2015 23:50:50 +0000 (00:50 +0100)
committerest31 <MTest31@outlook.com>
Tue, 29 Dec 2015 23:50:50 +0000 (00:50 +0100)
My commit

e2d54c9f9275e4f77ec33be8054621d42945f7a4 "shutdown when requested from lua in singleplayer too"

broke minetest's feature to connect to servers. The client crashed
after the connection init was complete.

Thanks to @sofar for reporting the bug.

Fixes #3498.

src/game.cpp

index 25424fa26c00f2afc389cf2b283fe099598a379d..7ada1791e7c86f4cbc8abf47973b4c6be065fdfa 100644 (file)
@@ -1818,7 +1818,7 @@ void Game::run()
 
        while (device->run()
                        && !(*kill || g_gamecallback->shutdown_requested
-                       || server->getShutdownRequested())) {
+                       || (server && server->getShutdownRequested()))) {
 
                /* Must be called immediately after a device->run() call because it
                 * uses device->getTimer()->getTime()