Double click on first item in databases in welcome window does not open the file. (Fixes #893)

This commit is contained in:
Michael Starke
2019-03-20 10:52:58 +01:00
parent 70c25c9b1f
commit b73de01897

View File

@@ -40,7 +40,7 @@
- (IBAction)openRecentURL:(id)sender {
NSInteger clicked = self.tableView.clickedRow;
NSArray <NSURL *> *recentURLS = NSDocumentController.sharedDocumentController.recentDocumentURLs;
if(clicked > 0 && clicked < recentURLS.count) {
if(clicked > -1 && clicked < recentURLS.count) {
[NSDocumentController.sharedDocumentController openDocumentWithContentsOfURL:recentURLS[clicked]
display:YES
completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) {}];