[Scummvm-git-logs] scummvm master -> 743bd78fb4492966177b73c421cc11c19475e983

sev- noreply at scummvm.org
Tue Dec 12 00:16:45 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
743bd78fb4 GUI: Fix crash when adding a game in some circumstances


Commit: 743bd78fb4492966177b73c421cc11c19475e983
    https://github.com/scummvm/scummvm/commit/743bd78fb4492966177b73c421cc11c19475e983
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-12T01:16:39+01:00

Commit Message:
GUI: Fix crash when adding a game in some circumstances

Changed paths:
    gui/widgets/groupedlist.cpp


diff --git a/gui/widgets/groupedlist.cpp b/gui/widgets/groupedlist.cpp
index e3ff7b58e0f..4248ec8f5b4 100644
--- a/gui/widgets/groupedlist.cpp
+++ b/gui/widgets/groupedlist.cpp
@@ -210,7 +210,7 @@ void GroupedListWidget::setSelected(int item) {
 		return;
 
 	// We only have to do something if the widget is enabled and the selection actually changes
-	if (isEnabled() && (_selectedItem == -1 || _listIndex[_selectedItem] != item)) {
+	if (isEnabled() && (_selectedItem == -1 || _selectedItem >= (int)_list.size() || _listIndex[_selectedItem] != item)) {
 		if (_editMode)
 			abortEditMode();
 




More information about the Scummvm-git-logs mailing list