aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-10-29 06:43:50 +0000
committerBibiko <bibiko@eva.mpg.de>2010-10-29 06:43:50 +0000
commitfb4d3131a958dabef17c3c58418e2601868e6f67 (patch)
tree2b578a98fadc6fb144c85d13244d07e8d2a293a0
parent886ee90ca1047fdef2c6bfd52ea28ffc0345aca4 (diff)
downloadsequelpro-fb4d3131a958dabef17c3c58418e2601868e6f67.tar.gz
sequelpro-fb4d3131a958dabef17c3c58418e2601868e6f67.tar.bz2
sequelpro-fb4d3131a958dabef17c3c58418e2601868e6f67.zip
• try to fix crash issue 1748
- it seems that isKindOfClass: method to check length and data type of the csv source while creating a new table failed for empty cells or NULL; I tried to catch these issues - has to be checked further
-rw-r--r--Source/SPFieldMapperController.m14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index c8d865c8..cbaed536 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -813,12 +813,14 @@ static const NSString *SPTableViewSqlColumnID = @"sql";
}
columnCounter = 0;
for(id col in row) {
- if([col isKindOfClass:[NSString class]] && maxLengthOfSourceColumns[columnCounter] < [col length]) {
- maxLengthOfSourceColumns[columnCounter] = [col length];
- }
- if(typeOfSourceColumns[columnCounter] == 1) {
- if(![[[NSNumber numberWithLongLong:[col longLongValue]] stringValue] isEqualToString:col])
- typeOfSourceColumns[columnCounter] = 0;
+ if(col && col != [NSNull null]) {
+ if([col isKindOfClass:[NSString class]] && maxLengthOfSourceColumns[columnCounter] < [col length]) {
+ maxLengthOfSourceColumns[columnCounter] = [col length];
+ }
+ if(typeOfSourceColumns[columnCounter] == 1) {
+ if(![[[NSNumber numberWithLongLong:[col longLongValue]] stringValue] isEqualToString:col])
+ typeOfSourceColumns[columnCounter] = 0;
+ }
}
columnCounter++;
}