When selecting a server with a LAN server in the list, pressing the down key when selecting the last server will crash
The bug
When selecting a server to play on in the "Multiplayer" menu, if the last server on your server list is selected, and there is a local network server on the list below it, pressing the "Down" arrow key will cause a crash.
Crash report
Description: keyPressed event handler java.lang.IndexOutOfBoundsException: Index: 10, Size: 9 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at bpo$b.a(SourceFile:100) at bpo$b.get(SourceFile:95) at btm.b(SourceFile:338) at btm.keyPressed(SourceFile:286) at bny.a(SourceFile:269) at bny$$Lambda$364/75867593.run(Unknown Source) at brs.a(SourceFile:426) at bny.a(SourceFile:267) at bny$$Lambda$270/2088661957.invoke(Unknown Source) at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:23) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:2599) at bol.a(SourceFile:294) at bob.b(SourceFile:848) at bob.a(SourceFile:382) at net.minecraft.client.main.Main.main(SourceFile:140)
Created Issue:
When selecting a server, pressing the down key when selecting the last server will crash
When selecting a server to play on in the "Multiplayer" menu, If the last server on your server list is selected, pressing the "Down" arrow key will cause a crash with an IndexOutOfBoundsException.
Environment
Windows 10
Java 1.8.0_101
Minecraft 1.10.2
Windows 10
Java 1.8.0_101
Minecraft 1.10.2Windows 10 (amd64)
Java 1.8.0_25
Minecraft 1.10.2
When selecting a server to play on in the "Multiplayer" menu,
If the last server on your server list is selected, pressing the "Down" arrow key will cause a crash with an IndexOutOfBoundsException.When selecting a server to play on in the "Multiplayer" menu, if the last server on your server list is selected, and there is a local network server on the list below it, pressing the "Down" arrow key will cause a crash with an IndexOutOfBoundsException.
When selecting a server with a LAN server in the list, pressing the down key when selecting the last server will crash
When selecting a server to play on in the "Multiplayer" menu, if the last server on your server list is selected, and there is a local network server on the list below it, pressing the "Down" arrow key will cause a crash
with an IndexOutOfBoundsException.The bug
When selecting a server to play on in the "Multiplayer" menu, if the last server on your server list is selected, and there is a local network server on the list below it, pressing the "Down" arrow key will cause a crash.
Crash report
Description: keyPressed event handler java.lang.IndexOutOfBoundsException: Index: 10, Size: 9 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at bpo$b.a(SourceFile:100) at bpo$b.get(SourceFile:95) at btm.b(SourceFile:338) at btm.keyPressed(SourceFile:286) at bny.a(SourceFile:269) at bny$$Lambda$364/75867593.run(Unknown Source) at brs.a(SourceFile:426) at bny.a(SourceFile:267) at bny$$Lambda$270/2088661957.invoke(Unknown Source) at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:23) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:2599) at bol.a(SourceFile:294) at bob.b(SourceFile:848) at bob.a(SourceFile:382) at net.minecraft.client.main.Main.main(SourceFile:140)
Windows 10 (amd64)
Java 1.8.0_25
Minecraft 1.10.2
is duplicated by
relates to
Please attach the crashlog.
Confirmed. This only happens if there is a LAN server in the list, though; if there is no LAN server on the list, then nothing happens.
I think this is caused by the following:
Minecraft might have an array or arraylist of servers (except for LAN) that appear in the server selection menu. When the down arrow is pressed, Minecraft tries to increment the index of the selected server. There is, of course, a check to make sure that you can't go beyond the bounds of the array/arraylist. The bound would be finding the total number of servers on the list, including the LAN servers. So when the last server is selected and the down arrow is pressed, Minecraft increments the index beyond the bounds of the array/arraylist, causing the exception
Source: Just an idea, might be completely wrong.
If I recall correctly, it is something like that (bounds-checking against one list but not the other list, or using the wrong list's size).
what it's doing it it's checking for lan array and server array as two separate arrays without checks for when it's last of server and down. Or first up on land and up arrow key
1.13 confirmed
so the solution is to either switch arrays when the key goes out of bounds or to prevent it entirely from switching indexes from one list to another
This has been fixed at some point.