aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-09-15 14:34:21 +0000
committerWillem Jan Palenstijn2009-09-15 14:34:21 +0000
commitcdb9b05697b05ec0489bdf40c9be5c7fd2767e26 (patch)
tree9468dd4d21dff437ea7417eb0ae098b045000039
parent6a9cc3b1e0675768d15ab43da5468eabd20c3179 (diff)
downloadscummvm-rg350-cdb9b05697b05ec0489bdf40c9be5c7fd2767e26.tar.gz
scummvm-rg350-cdb9b05697b05ec0489bdf40c9be5c7fd2767e26.tar.bz2
scummvm-rg350-cdb9b05697b05ec0489bdf40c9be5c7fd2767e26.zip
Fix crash when 'mass add' doesn't find any games
svn-id: r44104
-rw-r--r--gui/massadd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 4e43d342cb..9d4cf6a188 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -149,8 +149,10 @@ void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
ConfMan.flushToDisk();
// And scroll to first detected game
- sort(_games.begin(), _games.end(), GameDescLess());
- ConfMan.set("temp_selection", _games.front().gameid());
+ if (!_games.empty()) {
+ sort(_games.begin(), _games.end(), GameDescLess());
+ ConfMan.set("temp_selection", _games.front().gameid());
+ }
close();
} else if (cmd == kCancelCmd) {