Fix NPE when jumping to beginning of replay (before player is spawned)

This commit is contained in:
Jonas Herzig
2019-06-21 22:14:22 +02:00
parent 4213d37c76
commit e7deed73b5

View File

@@ -66,7 +66,7 @@ public class InputReplayTimer extends WrappedTimer {
// If we are in a replay, we have to manually process key and mouse events as the // If we are in a replay, we have to manually process key and mouse events as the
// tick speed may vary or there may not be any ticks at all (when the replay is paused) // tick speed may vary or there may not be any ticks at all (when the replay is paused)
if (mod.getReplayHandler() != null) { if (mod.getReplayHandler() != null && mc.world != null && mc.player != null) {
//#if MC>=11300 //#if MC>=11300
if (mc.currentScreen == null || mc.currentScreen.passEvents) { if (mc.currentScreen == null || mc.currentScreen.passEvents) {
GLFW.glfwPollEvents(); GLFW.glfwPollEvents();