aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-03-26 16:18:03 +0000
committerstuconnolly <stuart02@gmail.com>2010-03-26 16:18:03 +0000
commite9d49cbf9c48cbbff682c3f5f2e71c7c7a9e3b91 (patch)
treefbc18b7a7acc1269cd5e9a55c3f166af23dc93d8
parent52309a04b95bc6dea3ead6d1968bd6e17be285bf (diff)
downloadsequelpro-e9d49cbf9c48cbbff682c3f5f2e71c7c7a9e3b91.tar.gz
sequelpro-e9d49cbf9c48cbbff682c3f5f2e71c7c7a9e3b91.tar.bz2
sequelpro-e9d49cbf9c48cbbff682c3f5f2e71c7c7a9e3b91.zip
Before attempting to parse the create syntax of a table or view, check that it's not nil. This accommodates cases where the SHOW CREATE SYNTAX query caused the connection reconnect dialog to appear and the user chose the close the connection.
-rw-r--r--Source/SPTableData.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 1807b66e..b75f6dd5 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -350,6 +350,10 @@
NSArray *syntaxResult = [theResult fetchRowAsArray];
NSArray *resultFieldNames = [theResult fetchFieldNames];
+ // Only continue if syntaxResult is not nil. This accommodates causes where the above query caused the
+ // connection reconnect dialog to appear and the user chose to close the connection.
+ if (!syntaxResult) return nil;
+
if (tableCreateSyntax != nil) [tableCreateSyntax release];
tableCreateSyntax = [[NSString alloc] initWithString:[syntaxResult objectAtIndex:1]];