[evolution-data-server] [Camel] Check for session existence in store/folder maybe_connect
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] [Camel] Check for session existence in store/folder maybe_connect
- Date: Fri, 13 Nov 2015 15:14:11 +0000 (UTC)
commit b3c913efa6d27e82dc5b68efddd5cca3e2c9262b
Author: Milan Crha <mcrha redhat com>
Date: Fri Nov 13 16:12:17 2015 +0100
[Camel] Check for session existence in store/folder maybe_connect
While the session is supposed to be always there, it can be gone
in case of the application close, thus check for this too.
camel/camel-folder.c | 2 +-
camel/camel-store.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 4f62c7b..7452a80 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -528,7 +528,7 @@ folder_maybe_connect_sync (CamelFolder *folder,
service = CAMEL_SERVICE (parent_store);
session = camel_service_ref_session (service);
status = camel_service_get_connection_status (service);
- connect = camel_session_get_online (session) && (status != CAMEL_SERVICE_CONNECTED);
+ connect = session && camel_session_get_online (session) && (status != CAMEL_SERVICE_CONNECTED);
g_clear_object (&session);
if (connect && CAMEL_IS_NETWORK_SERVICE (parent_store)) {
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 6232c2b..1514da2 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -305,7 +305,7 @@ store_maybe_connect_sync (CamelStore *store,
service = CAMEL_SERVICE (store);
session = camel_service_ref_session (service);
status = camel_service_get_connection_status (service);
- connect = camel_session_get_online (session) && (status != CAMEL_SERVICE_CONNECTED);
+ connect = session && camel_session_get_online (session) && (status != CAMEL_SERVICE_CONNECTED);
g_clear_object (&session);
if (connect && CAMEL_IS_NETWORK_SERVICE (store)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]