summaryrefslogtreecommitdiff
path: root/src/com/dabomstew/pkrandom/newgui
diff options
context:
space:
mode:
authortom-overton <tom.overton@outlook.com>2021-12-16 13:46:56 -0800
committertom-overton <tom.overton@outlook.com>2021-12-16 13:48:02 -0800
commit10e1df36cb6e485e1e02388f579ef212dd232b66 (patch)
tree02339a966fbf968287a3adf51d2669d258fa51eb /src/com/dabomstew/pkrandom/newgui
parentde54f00e18a532366a2a14ef0c9f52b035ab1e0a (diff)
Don't attempt to write config for game update unless it successfuly loaded
Diffstat (limited to 'src/com/dabomstew/pkrandom/newgui')
-rw-r--r--src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java
index a9a1e98..d52b116 100644
--- a/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java
+++ b/src/com/dabomstew/pkrandom/newgui/NewRandomizerGUI.java
@@ -1148,8 +1148,6 @@ public class NewRandomizerGUI {
baseGameTitleIdChars[7] = 'E';
String expectedUpdateTitleId = String.valueOf(baseGameTitleIdChars);
if (actualUpdateTitleId.equals(expectedUpdateTitleId)) {
- gameUpdates.put(romHandler.getROMCode(), fh.getAbsolutePath());
- attemptWriteConfig();
try {
romHandler.loadGameUpdate(fh.getAbsolutePath());
} catch (EncryptedROMException ex) {
@@ -1161,6 +1159,8 @@ public class NewRandomizerGUI {
String.format(bundle.getString("GUI.unsupportedUpdate"), fh.getName()));
return;
}
+ gameUpdates.put(romHandler.getROMCode(), fh.getAbsolutePath());
+ attemptWriteConfig();
removeGameUpdateMenuItem.setVisible(true);
romNameLabel.setText(romHandler.getROMName() + " (" + romHandler.getGameUpdateVersion() + ")");
String text = String.format(bundle.getString("GUI.gameUpdateApplied"), romHandler.getROMName());