[evolution-kolab] EBookBackendKolab: do not operate on KolabMailAccess if backend is not opened



commit 1ae74240612246145e9c16ac184c865ebefe8ad2
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Wed Oct 24 16:13:00 2012 +0200

    EBookBackendKolab: do not operate on KolabMailAccess if backend is not opened

 src/addressbook/e-book-backend-kolab.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-kolab.c b/src/addressbook/e-book-backend-kolab.c
index 456144b..c953d8c 100644
--- a/src/addressbook/e-book-backend-kolab.c
+++ b/src/addressbook/e-book-backend-kolab.c
@@ -53,7 +53,7 @@
 /* This forces the GType to be registered in a way that
  * avoids a "statement with no effect" compiler warning.
  * FIXME Use g_type_ensure() once we require GLib 2.34. */
-#define REGISTER_TYPE(type) \
+#define REGISTER_TYPE(type)	  \
 	(g_type_class_unref (g_type_class_ref (type)))
 
 /*----------------------------------------------------------------------------*/
@@ -172,6 +172,12 @@ book_backend_kolab_signal_online_cb (GObject *object)
 	 *
 	 */
 
+	if (priv->book_koma == NULL) {
+		g_warning ("%s()[%u] Backend not been opened, ignoring online state request",
+		           __func__, __LINE__);
+		return;
+	}
+
 	(void) kolab_util_backend_deploy_mode_by_backend (priv->book_koma,
 	                                                  online,
 	                                                  NULL, /* GCancellable (see above) */
@@ -965,6 +971,12 @@ book_backend_kolab_start_book_view (EBookBackend *backend,
 
 	g_object_ref (book_view); /* unref()d in stop_view() */
 
+	if (priv->book_koma == NULL) {
+		g_warning ("%s()[%u] Backend not been opened, not updating view",
+		           __func__, __LINE__);
+		goto exit;
+	}
+
 	query = e_data_book_view_get_card_query (book_view);
 	foldername = kolab_util_backend_get_foldername (E_BACKEND (backend));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]