diff options
author | Max <post@wickenrode.com> | 2015-09-10 23:17:29 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-09-10 23:17:29 +0200 |
commit | fe050dfb404ccd15d34ef46b27274545d05e9c58 (patch) | |
tree | 60cd7cb675b631a5bedf25aca95c8cf7f173510c /Source/SPTableContentDelegate.m | |
parent | 6f00eaa2e639fa852793fe338627e089586463f2 (diff) | |
download | sequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.tar.gz sequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.tar.bz2 sequelpro-fe050dfb404ccd15d34ef46b27274545d05e9c58.zip |
Attempt at fixing a crash when trying to open the field editor sheet and Accessibility Services are enabled and a certain other Application is running (issue #2220)
Diffstat (limited to 'Source/SPTableContentDelegate.m')
-rw-r--r-- | Source/SPTableContentDelegate.m | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index 01252d4e..25ea9822 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -235,6 +235,11 @@ #endif if (tableView == tableContentView) { + // Nothing is editable while the field editor is running. + // This guards against a special case where accessibility services might + // check if a table field is editable while the sheet is running. + if (fieldEditor) return NO; + // Ensure that row is editable since it could contain "(not loaded)" columns together with // issue that the table has no primary key NSString *wherePart = [NSString stringWithString:[self argumentForRow:[tableContentView selectedRow]]]; @@ -303,8 +308,6 @@ fieldEncoding = [columnDefinition objectForKey:@"charset_name"]; } - if (fieldEditor) SPClear(fieldEditor); - fieldEditor = [[SPFieldEditorController alloc] init]; [fieldEditor setEditedFieldInfo:[NSDictionary dictionaryWithObjectsAndKeys: @@ -709,8 +712,8 @@ /** * If the user selected a table cell which is a blob field and tried to edit it - * cancel the fieldEditor, display the field editor sheet instead for editing - * and re-enable the fieldEditor after editing. + * cancel the inline edit, display the field editor sheet instead for editing + * and re-enable inline editing after closing the sheet. */ - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)aFieldEditor { @@ -767,6 +770,7 @@ // Cancel editing [control abortEditing]; + NSAssert(fieldEditor == nil, @"Method should not to be called while a field editor sheet is open!"); // Call the field editor sheet [self tableView:tableContentView shouldEditTableColumn:NSArrayObjectAtIndex([tableContentView tableColumns], column) row:row]; |