mojira.dev
MC-313052

Pressing an arrow key after pressing a mouse button other than left click over an entry in the Item Statistics menu crashes the game

In the Statistics screen’s Items section, pressing a mouse button other than left click (e.g. middle or right click) over an item entry and then pressing any arrow key will cause the game to crash with the following error:

Description: keyPressed event handler

java.lang.NullPointerException: keyPressed event handler
	at java.base/java.util.Objects.requireNonNull(Objects.java:220)
	at java.base/java.util.ImmutableCollections$List12.indexOf(ImmutableCollections.java:617)
	at net.minecraft.client.gui.components.ContainerObjectSelectionList.nextFocusPath(ContainerObjectSelectionList.java:44)
	at net.minecraft.client.gui.components.events.ContainerEventHandler.nextFocusPath(ContainerEventHandler.java:143)
	at net.minecraft.client.gui.screens.Screen.keyPressed(Screen.java:155)
	at net.minecraft.client.gui.screens.achievement.StatsScreen.keyPressed(StatsScreen.java:163)
	at net.minecraft.client.KeyboardHandler.keyPress(KeyboardHandler.java:506)
	at com.mojang.blaze3d.platform.SDLEventHandler.lambda$handleKeyEvent$0(SDLEventHandler.java:81)
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:174)
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23)
	at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:115)
	at com.mojang.blaze3d.platform.SDLEventHandler.handleKeyEvent(SDLEventHandler.java:81)
	at com.mojang.blaze3d.platform.SDLEventHandler.pollEvents(SDLEventHandler.java:39)
	at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:170)
	at net.minecraft.client.Minecraft.run(Minecraft.java:973)
	at net.minecraft.client.main.Main.main(Main.java:292)

Note however, pressing the Tab key will instead select the element that was clicked, and arrow keys can be safely used afterwards.

Steps to reproduce:

  1. Open the Items section of the Statistics screen.

  2. Press any mouse button other than left click when hovering over an item entry.

  3. Press any arrow key.

  4. Observe what happens.

Expected result:

The game wouldn’t crash.

Actual result:

This catastrophic series of events causes the game to cease operations.

Comments 0

No comments.

minecraft120

(Unassigned)

Unconfirmed

26.4 Snapshot 7

Retrieved