[folks] libsocialweb: Don't crash when D-Bus method Query.OpenView() returns an error



commit 6469bb1e62a720b323fc98a7d75b23197a58734c
Author: Alban Crequy <alban crequy collabora co uk>
Date:   Mon Mar 7 18:31:40 2011 +0000

    libsocialweb: Don't crash when D-Bus method Query.OpenView() returns an error

 backends/libsocialweb/sw-persona-store.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/backends/libsocialweb/sw-persona-store.vala b/backends/libsocialweb/sw-persona-store.vala
index afeee59..c0c8f6f 100644
--- a/backends/libsocialweb/sw-persona-store.vala
+++ b/backends/libsocialweb/sw-persona-store.vala
@@ -171,6 +171,11 @@ public class Folks.Backends.Sw.PersonaStore : Folks.PersonaStore
               this._service.query_open_view("people", parameters,
                   (query, item_view) =>
                     {
+                      /* The D-Bus call could return an error. In this case,
+                       * item_view is null */
+                      if (item_view == null)
+                        return;
+
                       item_view.items_added.connect (this.items_added_cb);
                       item_view.items_changed.connect (this.items_changed_cb);
                       item_view.items_removed.connect (this.items_removed_cb);



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