Skip to content

Commit

Permalink
Fix keyboard navigation crash (#814)
Browse files Browse the repository at this point in the history
- Fix crash when using keyboard navigation at the end of the list
  • Loading branch information
Dev0Louis authored Jan 6, 2025
1 parent 53f433f commit b60199e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.client.render.*;
import net.minecraft.text.Text;
import net.minecraft.util.math.MathHelper;
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;
import org.lwjgl.glfw.GLFW;

Expand Down Expand Up @@ -78,9 +79,13 @@ public void select(ModListEntry entry) {
}

@Override
public void setSelected(ModListEntry entry) {
public void setSelected(@Nullable ModListEntry entry) {
super.setSelected(entry);
selectedModId = entry.getMod().getId();
if (entry == null) {
selectedModId = null;
} else {
selectedModId = entry.getMod().getId();
}
parent.updateSelectedEntry(getSelectedOrNull());
}

Expand Down

0 comments on commit b60199e

Please sign in to comment.