aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTablesList.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-12-11 21:52:44 +0000
committerstuconnolly <stuart02@gmail.com>2010-12-11 21:52:44 +0000
commit1ddca4732c3aa46698b8fad25ce1294db3cd32fb (patch)
tree177ce5977ef37ea98ceae04bbce2f9ba73a0da4d /Source/SPTablesList.m
parent66f0041a06b8710cd3ed3b5ff2c8cbb54004efba (diff)
parentcb2baf9cb4ce1e33e6756969b1f71eb0e011f2c8 (diff)
downloadsequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.tar.gz
sequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.tar.bz2
sequelpro-1ddca4732c3aa46698b8fad25ce1294db3cd32fb.zip
Bring outlineview branch up to date with trunk (r2989:3005).
Diffstat (limited to 'Source/SPTablesList.m')
-rw-r--r--Source/SPTablesList.m9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index bbc40164..54e0f400 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -106,7 +106,14 @@
} else {
for ( i = 0 ; i < [theResult numOfRows] ; i++ ) {
resultRow = [theResult fetchRowAsArray];
- NSString *tableName = [NSString stringWithUTF8String:[[resultRow objectAtIndex:0] cStringUsingEncoding:[mySQLConnection stringEncoding]]];
+ // Due to encoding problems it can be the case that [resultRow objectAtIndex:0]
+ // return NSNull, thus catch that case for safety reasons
+ NSString *row = [resultRow objectAtIndex:0];
+ NSString *tableName;
+ if([row isKindOfClass:[NSString class]])
+ tableName = [NSString stringWithUTF8String:[row cStringUsingEncoding:[mySQLConnection stringEncoding]]];
+ else
+ tableName = @"...";
[tables addObject:tableName];
if ([[resultRow objectAtIndex:1] isEqualToString:@"VIEW"]) {
[tableTypes addObject:[NSNumber numberWithInteger:SPTableTypeView]];