Skip to content
Permalink
Browse files

Fix an exception that would occur when passing NSNull to a tooltip (a…

…ffected CSV field mapper)
  • Loading branch information...
dmoagx committed Jan 31, 2016
1 parent c196132 commit 9620e624a32fd0808e508bc5f0889ea847a185b2
Showing with 8 additions and 3 deletions.
  1. +8 −3 Source/SPFieldMapperController.m
@@ -1768,11 +1768,16 @@ - (NSString *)tableView:(NSTableView *)aTableView toolTipForCell:(NSCell *)aCell

}
else if([importFieldNamesHeaderSwitch state] == NSOffState) {
if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count])
return NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]);
NSUInteger colIndex = [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) unsignedIntegerValue];
NSString *retval;
if(colIndex >= [NSArrayObjectAtIndex(fieldMappingImportArray, 0) count])
retval = NSArrayObjectAtIndex(fieldMappingGlobalValues, colIndex);
else
return NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]);
retval = NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), colIndex);

if([retval isNSNull]) retval = NSLocalizedString(@"Value will be imported as MySQL NULL", @"CSV Field Mapping : Table View : Tooltip for fields with NULL value");

return retval;
}
}

0 comments on commit 9620e62

Please sign in to comment.
You can’t perform that action at this time.