GUI: Fix clicking in an empty space in the Grid Load dialog

This was unexpectedly closing the dialog.
This was a regression from 44e5d3f9 (GUI: Factor out save/load
activation to a function)
This commit is contained in:
Thierry Crozat 2021-08-27 22:49:34 +01:00
parent 89f92a007a
commit 5867d5420f

View File

@ -811,7 +811,7 @@ const Common::U32String &SaveLoadChooserGrid::getResultString() const {
void SaveLoadChooserGrid::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
const int slot = cmd + _curPage * _entriesPerPage - 1;
if (cmd <= _entriesPerPage) {
if (cmd <= _entriesPerPage && slot < _saveList.size()) {
activate(slot, Common::U32String());
}