aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-04-27 09:26:13 +0000
committerstuconnolly <stuart02@gmail.com>2010-04-27 09:26:13 +0000
commitf22d42877a8ea4ea5c67fc8a95a62cd00d2d74e2 (patch)
tree71e66ddc37d1b23e685ea8fe6161e12f9e683d49 /Frameworks
parent5af57456d3669d048c16831bd3a5afdb7ca9b2e2 (diff)
downloadsequelpro-f22d42877a8ea4ea5c67fc8a95a62cd00d2d74e2.tar.gz
sequelpro-f22d42877a8ea4ea5c67fc8a95a62cd00d2d74e2.tar.bz2
sequelpro-f22d42877a8ea4ea5c67fc8a95a62cd00d2d74e2.zip
Add extra connection checking at multiple stages of getting the server's process list. Fixes http://spbug.com/l/152.
Diffstat (limited to 'Frameworks')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m12
1 files changed, 7 insertions, 5 deletions
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];