diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2011-06-13 17:20:34 +0100 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-23 09:34:17 -0700 |
commit | 2d042c289bcc140f402c20603c12e57339815cf4 (patch) | |
tree | a9d0ce0a4f53376a3d5072409a7d9ccb2b8cbda3 | |
parent | 89a975951e2e52597c4193a9aafe27356588fff2 (diff) |
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
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | backends/telepathy/lib/tpf-logger.vala | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -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 |