MainFrame: fix crash when cancelling a dialog.
This commit is contained in:
parent
f8d8bb95e5
commit
8cac1a8360
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ void EvtMainFrame::moveMassEvent(wxCommandEvent&) {
|
||||||
"- If the destination already contains a M.A.S.S., the two will be swapped.\n"
|
"- If the destination already contains a M.A.S.S., the two will be swapped.\n"
|
||||||
"- If the destination contains invalid data, it will be cleared first.",
|
"- If the destination contains invalid data, it will be cleared first.",
|
||||||
*(_manager.massName(source_slot))),
|
*(_manager.massName(source_slot))),
|
||||||
"Slot", "Choose a slot", source_slot + 1, 1, 32, this) - 1;
|
"Slot", "Choose a slot", source_slot + 1, 1, 32, this);
|
||||||
|
|
||||||
if(choice == -1 || choice == source_slot) {
|
if(choice == -1 || choice == source_slot) {
|
||||||
return;
|
return;
|
||||||
|
@ -153,7 +153,7 @@ void EvtMainFrame::moveMassEvent(wxCommandEvent&) {
|
||||||
errorMessage(error_prefix + "For security reasons, moving a M.A.S.S. is disabled if the game's status is unknown.");
|
errorMessage(error_prefix + "For security reasons, moving a M.A.S.S. is disabled if the game's status is unknown.");
|
||||||
break;
|
break;
|
||||||
case GameState::NotRunning:
|
case GameState::NotRunning:
|
||||||
if(!_manager.moveMass(source_slot, choice)) {
|
if(!_manager.moveMass(source_slot, choice - 1)) {
|
||||||
errorMessage(error_prefix + _manager.lastError());
|
errorMessage(error_prefix + _manager.lastError());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue