From e9d49cbf9c48cbbff682c3f5f2e71c7c7a9e3b91 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 26 Mar 2010 16:18:03 +0000 Subject: 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. --- Source/SPTableData.m | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source') 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]]; -- cgit v1.2.3