Revision: 29401
          http://sourceforge.net/p/bibdesk/svn/29401
Author:   hofman
Date:     2025-07-30 15:31:49 +0000 (Wed, 30 Jul 2025)
Log Message:
-----------
check whether cite key is not nil

Modified Paths:
--------------
    trunk/bibdesk/BDSKDocumentController.m

Modified: trunk/bibdesk/BDSKDocumentController.m
===================================================================
--- trunk/bibdesk/BDSKDocumentController.m      2025-07-30 14:41:39 UTC (rev 
29400)
+++ trunk/bibdesk/BDSKDocumentController.m      2025-07-30 15:31:49 UTC (rev 
29401)
@@ -387,7 +387,7 @@
             NSDictionary *options = [customOpenSettings 
objectForKey:absoluteURL];
             if (options)
                 [customOpenSettings setObject:options forKey:fileURL];
-            NSString *citeKey = [dictionary 
objectForKey:@"net_sourceforge_bibdesk_citekey"] ?: [dictionary 
objectForKey:BDSKCiteKeyString];
+            NSString *citeKey = [dictionary 
objectForKey:@"net_sourceforge_bibdesk_citekey"];
             
             // use a local variable in case it wasn't passed in, so we can 
always log this failure
             [super openDocumentWithContentsOfURL:fileURL 
display:displayDocument completionHandler:^(NSDocument *document, BOOL 
documentWasAlreadyOpen, NSError *error){
@@ -395,7 +395,7 @@
                 if (document == nil) {
                     NSLog(@"document at URL %@ failed to open for reason: %@", 
fileURL, [error localizedFailureReason]);
                 } else if(displayDocument) {
-                    if (NO == [(BibDocument *)document 
selectItemsForCiteKeys:@[citeKey] selectLibrary:YES])
+                    if (citeKey == nil || NO == [(BibDocument *)document 
selectItemsForCiteKeys:@[citeKey] selectLibrary:YES])
                         NSBeep();
                     if ([NSString isEmptyString:searchString] == NO)
                         [(BibDocument *)document setSearchString:searchString];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to