diff options
author | rowanbeentje <rowan@beent.je> | 2012-03-24 12:47:23 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-03-24 12:47:23 +0000 |
commit | 21df6e7616419aa87513d61d1721394a7da9e16a (patch) | |
tree | dd8494d81026dabf9f976e27def63398dce18653 /Source/SPFieldMapperController.m | |
parent | 760c9b1c387ab827839b77db259537b97a1a8522 (diff) | |
download | sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.tar.gz sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.tar.bz2 sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.zip |
- Fix an exception when attempting to preserve the selection in a table with a primary key with multiple columns of which the first of which is a blob or binary type
- Clean up NSNull comparisons and add comments
- Clear the selection when filtering a table, allowing reselection to look a little more consistent
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r-- | Source/SPFieldMapperController.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 85caa27b..81c1c137 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -292,7 +292,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; NSMutableArray *globals = [NSMutableArray array]; for(NSUInteger i=0; i < [fieldMappingGlobalValues count]; i++) { id glob = NSArrayObjectAtIndex(fieldMappingGlobalValues, i); - if([NSArrayObjectAtIndex(fieldMappingGlobalValuesSQLMarked, i) boolValue] || glob == [NSNull null]) + if([NSArrayObjectAtIndex(fieldMappingGlobalValuesSQLMarked, i) boolValue] || [glob isNSNull]) [globals addObject:glob]; else [globals addObject:[NSString stringWithFormat:@"'%@'", [(NSString*)glob stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]]]; @@ -839,7 +839,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; } columnCounter = 0; for(id col in row) { - if(col && col != [NSNull null]) { + if(col && ![col isNSNull]) { if([col isKindOfClass:[NSString class]] && maxLengthOfSourceColumns[columnCounter] < (NSInteger)[(NSString*)col length]) { maxLengthOfSourceColumns[columnCounter] = [(NSString*)col length]; } @@ -1489,7 +1489,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; fieldMappingArray = [[NSMutableArray alloc] init]; for (i = 0; i < [fieldMappingTableColumnNames count]; i++) { if (i < [NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow) count] - && NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), i) != [NSNull null]) { + && ![NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), i) isNSNull]) { value = i; } else { value = 0; |