Fix NPE when loading second single-player world #284

Merged
merged 1 commit into from Sep 23, 2013

2 participants

@smcv

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)

Simon McVittie Fix NPE when loading second single-player world
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)
4a94c2c
@cpw cpw merged commit 0e80fcb into MinecraftForge:master Sep 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment