diff options
author | rowanbeentje <rowan@beent.je> | 2014-04-26 22:17:13 -0400 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2014-04-26 22:17:13 -0400 |
commit | 5b8798438f06850e7dfd4d6d802d13f96f5bac87 (patch) | |
tree | b59d9b4d82e9c1797a2187db3b81866732a08596 /Source | |
parent | f387da0349f567e98c94544191df64881304a959 (diff) | |
download | sequelpro-5b8798438f06850e7dfd4d6d802d13f96f5bac87.tar.gz sequelpro-5b8798438f06850e7dfd4d6d802d13f96f5bac87.tar.bz2 sequelpro-5b8798438f06850e7dfd4d6d802d13f96f5bac87.zip |
Fix an issue where CSV imports could not be started if a zero-length field was set to not be imported
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPFieldMapperController.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index c2e507f0..249a8f02 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -1575,18 +1575,18 @@ static NSString *SPTableViewSqlColumnID = @"sql"; { BOOL enableImportButton = YES; - if(newTableMode) { - if(![tablesListInstance isTableNameValid:[newTableNameTextField stringValue] forType:SPTableTypeTable ignoringSelectedTable:NO]) { + if (newTableMode) { + if (![tablesListInstance isTableNameValid:[newTableNameTextField stringValue] forType:SPTableTypeTable ignoringSelectedTable:NO]) { [importButton setEnabled:NO]; return; } - for(NSString* fieldName in fieldMappingTableColumnNames) { - if(![fieldName length]) { + for (NSUInteger i = 0; i < [fieldMappingTableColumnNames count]; i++) { + if (![[fieldMappingTableColumnNames objectAtIndex:i] length] && [fieldMappingOperatorArray objectAtIndex:i] == doImport) { [importButton setEnabled:NO]; return; } } - for(NSString* fieldType in fieldMappingTableTypes) { + for (NSString* fieldType in fieldMappingTableTypes) { if(![fieldType length]) { [importButton setEnabled:NO]; return; @@ -1594,7 +1594,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; } } - if([[self selectedImportMethod] isEqualToString:@"UPDATE"]) { + if ([[self selectedImportMethod] isEqualToString:@"UPDATE"]) { enableImportButton = NO; for(id op in fieldMappingOperatorArray) { if(op == isEqual) { |