Skip to content

Commit

Permalink
make sure Legacy4JData isn't null when reading from it
Browse files Browse the repository at this point in the history
  • Loading branch information
Jab125 committed Oct 17, 2024
1 parent 85e289a commit c8cd3a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static void openLegacy4JUserPicker() {
}

public static void openLegacy4JUserPicker(Legacy4JData data) {
ScreenUtil.getLegacyOptions().selectedController().set(data.controllerIndex());
if (data != null) ScreenUtil.getLegacyOptions().selectedController().set(data.controllerIndex());
ChooseUserScreen chooseUserScreen = new ChooseUserScreen(null);
((AuthCallback)chooseUserScreen).hotjoin$authResponse(s -> {
Minecraft.getInstance().getToasts().addToast(new LegacyTip(Component.literal("Success, joining world...")));
Expand Down Expand Up @@ -156,7 +156,7 @@ public void onBeginScreenSet(Screen previousScreen, Screen newScreen) {
if (newScreen instanceof ConfirmationScreen) {

} else {
ScreenUtil.getLegacyOptions().selectedController().set(o.oldControllerIndex());
if (o != null) ScreenUtil.getLegacyOptions().selectedController().set(o.oldControllerIndex());
}
}
}
Expand Down

0 comments on commit c8cd3a0

Please sign in to comment.