diff --git a/src/ui/osx/TogglDesktop/TimeEntryEditViewController.m b/src/ui/osx/TogglDesktop/TimeEntryEditViewController.m index 2f5945dfad..14cb1919b7 100644 --- a/src/ui/osx/TogglDesktop/TimeEntryEditViewController.m +++ b/src/ui/osx/TogglDesktop/TimeEntryEditViewController.m @@ -1328,6 +1328,11 @@ - (NSView *) tableView:(NSTableView *)tableView dataSource = self.liteProjectAutocompleteDataSource; } + if (dataSource == nil || row >= dataSource.filteredOrderedKeys.count) + { + return nil; + } + @synchronized(self) { item = [dataSource.filteredOrderedKeys objectAtIndex:row]; diff --git a/src/ui/osx/TogglDesktop/TimerEditViewController.m b/src/ui/osx/TogglDesktop/TimerEditViewController.m index 9b20d113bd..cd8008ae4a 100644 --- a/src/ui/osx/TogglDesktop/TimerEditViewController.m +++ b/src/ui/osx/TogglDesktop/TimerEditViewController.m @@ -613,7 +613,7 @@ - (NSView *) tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { - if (row < 0) + if (row < 0 || row >= self.liteAutocompleteDataSource.filteredOrderedKeys.count) { return nil; }