aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldMapperController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r--Source/SPFieldMapperController.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index cbaed536..0be1c4d4 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -1370,7 +1370,9 @@ static const NSString *SPTableViewSqlColumnID = @"sql";
CGFloat minDist = 1e6;
NSInteger minIndex = 0;
for(j=0; j < [fileHeaderNames count]; j++) {
- NSString *headerName = [NSArrayObjectAtIndex(fileHeaderNames,j) lowercaseString];
+ id fileHeaderName = NSArrayObjectAtIndex(fileHeaderNames,j);
+ if([fileHeaderName isKindOfClass:[NSNull class]] || [fileHeaderName isSPNotLoaded]) continue;
+ NSString *headerName = [(NSString*)fileHeaderName lowercaseString];
CGFloat dist = [[NSArrayObjectAtIndex(tableHeaderNames,i) lowercaseString] levenshteinDistanceWithWord:headerName];
if(dist < minDist && ![matchedHeaderNames containsObject:headerName]) {
minDist = dist;