aboutsummaryrefslogtreecommitdiff
path: root/gui/dialog.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-27 13:27:34 +0000
committerMax Horn2002-07-27 13:27:34 +0000
commit403afb0514a796c77d004b5be342946ffc023953 (patch)
treed0c3ab61c3649a0fe021b33a3e37ec397970c27c /gui/dialog.cpp
parentea7c0aa94b73ecae1c83240afa31b774c2a21940 (diff)
downloadscummvm-rg350-403afb0514a796c77d004b5be342946ffc023953.tar.gz
scummvm-rg350-403afb0514a796c77d004b5be342946ffc023953.tar.bz2
scummvm-rg350-403afb0514a796c77d004b5be342946ffc023953.zip
added isEmpty() methods to String and List class; fixed crasher that occured when saving/loading in NewGUI when nothing was selected
svn-id: r4655
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r--gui/dialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 88c9cecc51..c4f53892c7 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -304,7 +304,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
{
switch (cmd) {
case kSaveCmd:
- if (_savegameList->getSelectedString()[0] != 0) {
+ if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) {
Scumm *s = _gui->getScumm();
s->_saveLoadSlot = _savegameList->getSelected();
s->_saveLoadCompatible = false;
@@ -314,7 +314,7 @@ void SaveLoadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
break;
case kLoadCmd:
- if (_savegameList->getSelectedString()[0] != 0) {
+ if (_savegameList->getSelected() > 0 && !_savegameList->getSelectedString().isEmpty()) {
Scumm *s = _gui->getScumm();
s->_saveLoadSlot = _savegameList->getSelected();
s->_saveLoadCompatible = false;