Revision: 29080
http://sourceforge.net/p/bibdesk/svn/29080
Author: hofman
Date: 2025-02-28 14:41:49 +0000 (Fri, 28 Feb 2025)
Log Message:
-----------
check for nil base object also when not an array
Modified Paths:
--------------
trunk/bibdesk/BibDocument+Scripting.m
Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m 2025-02-28 14:39:36 UTC (rev
29079)
+++ trunk/bibdesk/BibDocument+Scripting.m 2025-02-28 14:41:49 UTC (rev
29080)
@@ -835,13 +835,11 @@
// First find the index of the first or last base object in the groups
array
// Base specifiers are to be evaluated within the same container as the
relative specifier they are the base of. That's this document.
id baseObject = [baseSpec objectsByEvaluatingWithContainers:self];
- if ([baseObject isKindOfClass:[NSArray class]]) {
- if ([baseObject count] == 0)
- // Oops. We could not find the base object.
- return nil;
-
+ if ([baseObject isKindOfClass:[NSArray class]])
baseObject = (isBefore ? [baseObject firstObject] : [baseObject
lastObject]);
- }
+ if (baseObject == nil)
+ // Oops. We could not find the base object.
+ return nil;
baseIndex = [allGroups indexOfObjectIdenticalTo:baseObject];
if (baseIndex == NSNotFound)
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