From f22d42877a8ea4ea5c67fc8a95a62cd00d2d74e2 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 27 Apr 2010 09:26:13 +0000 Subject: Add extra connection checking at multiple stages of getting the server's process list. Fixes http://spbug.com/l/152. --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Frameworks') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 5fd3a9a2..27ae11ae 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -2412,12 +2412,14 @@ void performThreadedKeepAlive(void *ptr) [self lockConnection]; - if (theResPtr = mysql_list_processes(mConnection)) { - result = [[MCPResult alloc] initWithResPtr:theResPtr encoding:mEncoding timeZone:mTimeZone]; + if (mConnected && (mConnection != NULL)) { + if (theResPtr = mysql_list_processes(mConnection)) { + result = [[MCPResult alloc] initWithResPtr:theResPtr encoding:mEncoding timeZone:mTimeZone]; + } + else { + result = [[MCPResult alloc] init]; + } } - else { - result = [[MCPResult alloc] init]; - } [self unlockConnection]; -- cgit v1.2.3