Revision: 30051
          http://sourceforge.net/p/bibdesk/svn/30051
Author:   hofman
Date:     2026-02-24 17:09:45 +0000 (Tue, 24 Feb 2026)
Log Message:
-----------
check forr NSNotFound first

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

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2026-02-24 16:48:09 UTC (rev 30050)
+++ trunk/bibdesk/BDSKEditor.m  2026-02-24 17:09:45 UTC (rev 30051)
@@ -2416,18 +2416,20 @@
             [authorTableView reloadData];
         
         NSInteger row = [fields indexOfObject:changeKey];
-        if (row >= minNumberOfFields && ([NSString 
isEmptyAsComplexString:newValue] != [NSString 
isEmptyAsComplexString:oldValue])) {
-                       // a custom field was added or removed
-            [self reloadTableIgnoringEditsForField:changeKey];
-        } else if (row != NSNotFound) {
-            // a field value changed
-            // don't use newValue, because this can be the parent's value
-            NSString *tmpValue = [publication valueOfField:changeKey] ?: @"";
-            BDSKEditorTextField *textField = [self textFieldAtRow:row];
-            [textField setObjectValue:tmpValue];
-            [textField setRepresentedObject:[self 
representedObjectForValue:tmpValue forField:changeKey]];
-            if ([textField currentEditor] && [tableCellFormatter 
editAsComplexString])
-                [tableCellFormatter didStartEditor:[textField currentEditor]];
+        if (row != NSNotFound) {
+            if (row >= minNumberOfFields && ([NSString 
isEmptyAsComplexString:newValue] != [NSString 
isEmptyAsComplexString:oldValue])) {
+                // a custom field was added or removed
+                [self reloadTableIgnoringEditsForField:changeKey];
+            } else {
+                // a field value changed
+                // don't use newValue, because this can be the parent's value
+                NSString *tmpValue = [publication valueOfField:changeKey] ?: 
@"";
+                BDSKEditorTextField *textField = [self textFieldAtRow:row];
+                [textField setObjectValue:tmpValue];
+                [textField setRepresentedObject:[self 
representedObjectForValue:tmpValue forField:changeKey]];
+                if ([textField currentEditor] && [tableCellFormatter 
editAsComplexString])
+                    [tableCellFormatter didStartEditor:[textField 
currentEditor]];
+            }
         }
     }
     

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