Skip to content

Commit 0711225

Browse files
committed
fix incorrect GRPs list traversal in macOS startup window
1 parent e1106b6 commit 0711225

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/GameListSource.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ - (id)tableView:(NSTableView *)aTableView
3434
int row;
3535
struct grpfile const *fg = GroupsFound();
3636

37-
for (row = 0; row < rowIndex && fg; fg = fg->next) {
38-
if (fg->ref) row++;
37+
while (fg && !fg->ref) fg = fg->next;
38+
for (row = 0; fg; fg = fg->next) {
39+
if (fg->ref) {
40+
if (row == rowIndex) break;
41+
row++;
42+
}
3943
}
4044
if (!fg) {
4145
return nil;
4246
}
4347
switch ([[aTableColumn identifier] intValue]) {
4448
case 0: // name column
45-
if (fg->ref) {
46-
return [NSString stringWithUTF8String: fg->ref->name];
47-
} else {
48-
return @"Unknown game";
49-
}
49+
return [NSString stringWithUTF8String: fg->ref->name];
5050
case 1: // grp column
5151
return [NSString stringWithUTF8String: fg->name];
5252
case 2: // hidden column pointing to the grpfile entry.

0 commit comments

Comments
 (0)