aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2016-08-30 21:22:59 +0100
committerThierry Crozat2016-08-30 21:37:34 +0100
commit7edc96803e5af76a8253a0f168590633ff43866f (patch)
treecb1ec14c20e4ffca9fe1853aaffe6aac0b6e064a
parent89ff116865dd3a1795f9b841c89e39be44bbe05b (diff)
downloadscummvm-rg350-7edc96803e5af76a8253a0f168590633ff43866f.tar.gz
scummvm-rg350-7edc96803e5af76a8253a0f168590633ff43866f.tar.bz2
scummvm-rg350-7edc96803e5af76a8253a0f168590633ff43866f.zip
CLOUD: Fix crash when trying to connect without entering a code first
-rw-r--r--gui/storagewizarddialog.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/gui/storagewizarddialog.cpp b/gui/storagewizarddialog.cpp
index 60f31d1e38..8dcea1c774 100644
--- a/gui/storagewizarddialog.cpp
+++ b/gui/storagewizarddialog.cpp
@@ -242,10 +242,12 @@ void StorageWizardDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
code += subcode;
code.deleteLastChar();
}
- code.erase(code.size() - 3);
- CloudMan.connectStorage(_storageId, code);
- setResult(1);
- close();
+ if (code.size() > 3) {
+ code.erase(code.size() - 3);
+ CloudMan.connectStorage(_storageId, code);
+ setResult(1);
+ close();
+ }
break;
}
#ifdef USE_SDL_NET