MinecraftForge/FML — pull request #284 by smcv (2013-09-22 16:21:11+00:00)
Title: Fix NPE when loading second single-player world

*Steps to reproduce*

* Have two single-player worlds
* Start a single-player game in the first world
* Press Esc, "Save and quit"
* Start a single-player game in the second world

*Expected result*

* Second world loads correctly

*Actual result*

* GUI screen stops at an empty dirt background, before the point at which loading messages start to appear
* Debug log shows the stack trace and errors mentioned in the commit message below

The patch gives the expected result.

---

After leaving a single-player world, getServer() can return null, resulting
in the stack trace below, "Fatal errors were detected during the
transition from SERVER_STOPPING to SERVER_ABOUT_TO_START",
"The ForgeModLoader state engine has become corrupted" and the client
getting stuck forever.

Exception in thread "Server thread" java.lang.NullPointerException
at cpw.mods.fml.client.FMLClientHandler.serverStopped(FMLClientHandler.java:620)
at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)