Revision: 29078
          http://sourceforge.net/p/bibdesk/svn/29078
Author:   hofman
Date:     2025-02-28 14:33:38 +0000 (Fri, 28 Feb 2025)
Log Message:
-----------
change order of checks

Modified Paths:
--------------
    trunk/bibdesk/BibDocument+Scripting.m

Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m       2025-02-28 10:37:43 UTC (rev 
29077)
+++ trunk/bibdesk/BibDocument+Scripting.m       2025-02-28 14:33:38 UTC (rev 
29078)
@@ -719,7 +719,6 @@
     NSScriptObjectSpecifier *endSpec = [rangeSpec endSpecifier];
     NSString *startKey = [startSpec key];
     NSString *endKey = [endSpec key];
-    NSArray *allGroups = [self scriptingGroups];
     
     if ((startSpec == nil) && (endSpec == nil))
         // We need to have at least one of these...
@@ -729,14 +728,11 @@
         // Just an ordinary range of (a type of) groups.  Let the scripting 
engine handle this.
         return nil;
     
-    if ([allGroups count] == 0)
-        // If there are no groups, there can be no match.  Just return now.
-        return @[];
-    
     if ((startSpec && [groupKeys() containsObject:startKey] == NO) || (endSpec 
&& [groupKeys() containsObject:endKey]) == NO)
         // The start or end key is not a group key.
         return nil;
     
+    NSArray *allGroups = [self scriptingGroups];
     BOOL keyIsGroups = [key isEqual:@"scriptingGroups"];
     NSArray *rangeKeyObjects = (keyIsGroups ? nil : [self valueForKey:key]);
     NSUInteger startIndex;
@@ -743,6 +739,10 @@
     NSUInteger endIndex;
     id object;
     
+    if ([allGroups count] == 0)
+        // If there are no groups, there can be no match.  Just return now.
+        return @[];
+    
     if (keyIsGroups == NO && [rangeKeyObjects count] == 0)
         // If there are no groups for the key, there can be no match.  Just 
return now.
         return @[];

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to