macOS: Fix crash in startup window when no game data is found.

git-svn-id: https://svn.eduke32.com/eduke32@6448 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-09-23 03:17:32 +00:00
parent c07e705c48
commit 36eb156d7d

View file

@ -527,14 +527,18 @@ static struct {
[[gameList documentView] setDataSource:gamelistsrc]; [[gameList documentView] setDataSource:gamelistsrc];
[[gameList documentView] deselectAll:nil]; [[gameList documentView] deselectAll:nil];
int row = [gamelistsrc findIndexForGrpname:[NSString stringWithUTF8String:settings.grp->filename]]; if (settings.grp)
if (row >= 0) { {
[[gameList documentView] scrollRowToVisible:row]; int row = [gamelistsrc findIndexForGrpname:[NSString stringWithUTF8String:settings.grp->filename]];
if (row >= 0)
{
[[gameList documentView] scrollRowToVisible:row];
#if defined MAC_OS_X_VERSION_10_3 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3 #if defined MAC_OS_X_VERSION_10_3 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
[[gameList documentView] selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; [[gameList documentView] selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
#else #else
[[gameList documentView] selectRow:row byExtendingSelection:NO]; [[gameList documentView] selectRow:row byExtendingSelection:NO];
#endif #endif
}
} }
[cancelButton setEnabled:true]; [cancelButton setEnabled:true];