Merge pull request #284 from smcv/uninit

Fix NPE when loading second single-player world
This commit is contained in:
cpw 2013-09-22 18:24:56 -07:00
commit cc3f0b0eea
1 changed files with 4 additions and 2 deletions

View File

@ -617,9 +617,11 @@ public class FMLClientHandler implements IFMLSidedHandler
public void serverStopped() public void serverStopped()
{ {
// If the server crashes during startup, it might hang the client- reset the client so it can abend properly. // If the server crashes during startup, it might hang the client- reset the client so it can abend properly.
if (!getServer().func_71200_ad()) MinecraftServer server = getServer();
if (server != null && !server.func_71200_ad())
{ {
ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, getServer(), true, "field_71296"+"_Q","serverIs"+"Running"); ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running");
} }
} }
} }