From fce2447e7d042ad3f9313716e78cadb91a02e908 Mon Sep 17 00:00:00 2001 From: Arek Holko Date: Thu, 26 Apr 2018 03:11:55 +0200 Subject: Fix crash by adding check if owner is still present (#1707) --- src/async/imap/MCIMAPAsyncConnection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/async/imap/MCIMAPAsyncConnection.cpp b/src/async/imap/MCIMAPAsyncConnection.cpp index 4ae633ec..df514dd9 100644 --- a/src/async/imap/MCIMAPAsyncConnection.cpp +++ b/src/async/imap/MCIMAPAsyncConnection.cpp @@ -57,14 +57,18 @@ namespace mailcore { virtual void queueStartRunning() { mConnection->setQueueRunning(true); - mConnection->owner()->operationRunningStateChanged(); + if (mConnection->owner()) { + mConnection->owner()->operationRunningStateChanged(); + } mConnection->queueStartRunning(); } virtual void queueStoppedRunning() { mConnection->setQueueRunning(false); mConnection->tryAutomaticDisconnect(); - mConnection->owner()->operationRunningStateChanged(); + if (mConnection->owner()) { + mConnection->owner()->operationRunningStateChanged(); + } mConnection->queueStoppedRunning(); } -- cgit v1.2.3