CLOUD: Fix crash when trying to connect without entering a code first

This commit is contained in:
Thierry Crozat 2016-08-30 21:22:59 +01:00
parent 89ff116865
commit 7edc96803e

View File

@ -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