From 66bfbd041a63b214ae353d668176372282e53595 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 24 Mar 2012 17:13:11 +0000 Subject: - Fix exceptions caused when resizing custom query columns which don't map to underlying table columns on certain 5.0.x MySQL versions --- Source/SPCustomQuery.m | 6 +++--- 1 file 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 -- cgit v1.2.3