Ensure we prepare all TpAccounts before trying to use them.
authorPhilip Withnall <philip@tecnocode.co.uk>
Mon, 26 Sep 2011 22:36:39 +0000 (15:36 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 26 Sep 2011 22:59:53 +0000 (15:59 -0700)
Helps: bgo#659041 - tpf-persona-store.vala: try to connect to a NULL object

backends/telepathy/lib/tpf-persona-store.vala

index 3ee7402..fb7363b 100644 (file)
@@ -533,7 +533,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
    *
    * See {@link Folks.PersonaStore.prepare}.
    */
-  public override async void prepare ()
+  public override async void prepare () throws GLib.Error
     {
       lock (this._is_prepared)
         {
@@ -580,6 +580,9 @@ public class Tpf.PersonaStore : Folks.PersonaStore
                   this._logger = null;
                 }
 
+              /* Ensure the account's prepared first. */
+              yield this.account.prepare_async (null);
+
               this.account.status_changed.connect (
                   this._account_status_changed_cb);