[folks] Bug 652472 — Handle failure in getting the logger service better



commit 2d042c289bcc140f402c20603c12e57339815cf4
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Jun 13 17:20:34 2011 +0100

    Bug 652472 â Handle failure in getting the logger service better
    
    If we fail to get the logger from the bus, get_object() may return NULL. If
    we check for this, we don't then try and connect a signal to a NULL object
    instance and emit criticals.
    
    Closes: bgo#652472

 NEWS                                   |    1 +
 backends/telepathy/lib/tpf-logger.vala |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3224224..b3c2c36 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Bugs fixed:
 * Bug 652463 â Tidy up CLEANFILES
 * Bug 652434 â Add ability to run any tests through gdb
 * Bug 648071 â Add support for presence status from Telepathy
+* Bug 652472 â Handle failure in getting the logger service better
 
 API changes:
 * Swf.Persona retains and exposes its libsocialweb Contact
diff --git a/backends/telepathy/lib/tpf-logger.vala b/backends/telepathy/lib/tpf-logger.vala
index b130626..e930638 100644
--- a/backends/telepathy/lib/tpf-logger.vala
+++ b/backends/telepathy/lib/tpf-logger.vala
@@ -74,6 +74,13 @@ internal class Logger : GLib.Object
               "/org/freedesktop/Telepathy/Logger",
               "org.freedesktop.Telepathy.Logger.DRAFT") as LoggerIface;
 
+          /* Failure? */
+          if (this._logger == null)
+            {
+              this.invalidated ();
+              return retval;
+            }
+
           this._logger.destroy.connect (() =>
             {
               /* We've lost the connection to the logger service, so invalidate



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