fix crash returning to "Edit Profile" after cancelling world import

This commit is contained in:
LAX1DUDE 2022-08-04 17:56:21 -07:00
parent 011168f3e8
commit 6006fd8f87
2 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,7 @@ public class GuiNameWorldImport extends GuiScreen {
protected void actionPerformed(GuiButton par1GuiButton) {
if (par1GuiButton.enabled) {
if (par1GuiButton.id == 1) {
EaglerAdapter.clearFileChooserResult();
this.mc.displayGuiScreen(this.parentGuiScreen);
} else if (par1GuiButton.id == 0) {
this.buttonList.clear();

View File

@ -1908,6 +1908,10 @@ public class EaglerAdapterImpl2 {
}
return ret;
}
public static final void clearFileChooserResult() {
getFileChooserResult0();
}
@JSBody(params = { }, script = "var ret = window.eagsFileChooser.getFileChooserResult; window.eagsFileChooser.getFileChooserResult = null; return ret;")
private static native ArrayBuffer getFileChooserResult0();