From 48b162d72dc3e470e95de8259901e9689d229668 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 8 Sep 2014 11:45:00 -0500 Subject: in notifier.c, don't call notify_get_server_caps() if notify_init() failed. --- src/notifier.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/notifier.c') diff --git a/src/notifier.c b/src/notifier.c index ed079e5..a059447 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -361,18 +361,21 @@ indicator_power_notifier_init (IndicatorPowerNotifier * self) GList * caps; GList * l; + actions_supported = FALSE; + if (!notify_init("indicator-power-service")) { g_critical("Unable to initialize libnotify! Notifications might not be shown."); } - - /* see if actions are supported */ - actions_supported = FALSE; - caps = notify_get_server_caps(); - for (l=caps; l!=NULL && !actions_supported; l=l->next) - if (!g_strcmp0(l->data, "actions")) - actions_supported = TRUE; - g_list_free_full(caps, g_free); + else + { + /* see if actions are supported */ + caps = notify_get_server_caps(); + for (l=caps; l!=NULL && !actions_supported; l=l->next) + if (!g_strcmp0(l->data, "actions")) + actions_supported = TRUE; + g_list_free_full(caps, g_free); + } } } -- cgit v1.2.3