diff --git a/macosx/GroupsPrefsController.m b/macosx/GroupsPrefsController.m index 01b4b825c..9a3db3893 100644 --- a/macosx/GroupsPrefsController.m +++ b/macosx/GroupsPrefsController.m @@ -168,9 +168,16 @@ [fTableView reloadData]; - NSInteger selectedRow = [fTableView selectedRow]; - if (selectedRow != -1) - [fTableView scrollRowToVisible: selectedRow]; + if ([fTableView numberOfRows] > 0) + { + if (row == [fTableView numberOfRows]) + { + --row; + [fTableView selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; + } + + [fTableView scrollRowToVisible: row]; + } break; }