diff options
author | rowanbeentje <rowan@beent.je> | 2012-03-24 17:13:11 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-03-24 17:13:11 +0000 |
commit | 66bfbd041a63b214ae353d668176372282e53595 (patch) | |
tree | abfdc07889812f14ec95dc237d5e2a591d6ff702 | |
parent | c856251c9c3a276e6f06ee6fd90d998eb5e96958 (diff) | |
download | sequelpro-66bfbd041a63b214ae353d668176372282e53595.tar.gz sequelpro-66bfbd041a63b214ae353d668176372282e53595.tar.bz2 sequelpro-66bfbd041a63b214ae353d668176372282e53595.zip |
- Fix exceptions caused when resizing custom query columns which don't map to underlying table columns on certain 5.0.x MySQL versions
-rw-r--r-- | Source/SPCustomQuery.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 3388b035..8b9d9a74 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2516,15 +2516,15 @@ // Retrieve the original index of the column from the identifier NSInteger columnIndex = [[[[aNotification userInfo] objectForKey:@"NSTableColumn"] identifier] integerValue]; NSDictionary *columnDefinition = NSArrayObjectAtIndex(cqColumnDefinition, columnIndex); + NSString *table = [columnDefinition objectForKey:@"org_table"]; + NSString *col = [columnDefinition objectForKey:@"org_name"]; // Don't save if the column doesn't map to an underlying SQL field - if (![columnDefinition objectForKey:@"org_name"] || ![(NSString *)[columnDefinition objectForKey:@"org_name"] length]) + if (!table || ![table length] || !col || ![col length]) return; NSMutableDictionary *tableColumnWidths; NSString *host_db = [NSString stringWithFormat:@"%@@%@", [columnDefinition objectForKey:@"db"], [tableDocumentInstance host]]; - NSString *table = [columnDefinition objectForKey:@"org_table"]; - NSString *col = [columnDefinition objectForKey:@"org_name"]; // Retrieve or instantiate the tableColumnWidths object #ifndef SP_REFACTOR |