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,8 +527,11 @@ static struct {
[[gameList documentView] setDataSource:gamelistsrc]; [[gameList documentView] setDataSource:gamelistsrc];
[[gameList documentView] deselectAll:nil]; [[gameList documentView] deselectAll:nil];
if (settings.grp)
{
int row = [gamelistsrc findIndexForGrpname:[NSString stringWithUTF8String:settings.grp->filename]]; int row = [gamelistsrc findIndexForGrpname:[NSString stringWithUTF8String:settings.grp->filename]];
if (row >= 0) { if (row >= 0)
{
[[gameList documentView] scrollRowToVisible:row]; [[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];
@ -536,6 +539,7 @@ static struct {
[[gameList documentView] selectRow:row byExtendingSelection:NO]; [[gameList documentView] selectRow:row byExtendingSelection:NO];
#endif #endif
} }
}
[cancelButton setEnabled:true]; [cancelButton setEnabled:true];
[startButton setEnabled:true]; [startButton setEnabled:true];