aboutsummaryrefslogtreecommitdiff
path: root/src/notifier.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-01-04 10:10:25 -0600
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-28 10:17:14 +0200
commit27122e92856bbe4efcdfc4975b46a0c6dee67cb9 (patch)
tree5111d37fbedc52ba7000ffe958115f249abe4f42 /src/notifier.c
parentafc091939635eb46f2947cfe1aaadcb408de2835 (diff)
downloadayatana-indicator-power-27122e92856bbe4efcdfc4975b46a0c6dee67cb9.tar.gz
ayatana-indicator-power-27122e92856bbe4efcdfc4975b46a0c6dee67cb9.tar.bz2
ayatana-indicator-power-27122e92856bbe4efcdfc4975b46a0c6dee67cb9.zip
assume we're in silent mode if we can't get an accounts-service proxy
Diffstat (limited to 'src/notifier.c')
-rw-r--r--src/notifier.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/notifier.c b/src/notifier.c
index 696556a..4b7aede 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -187,8 +187,12 @@ silent_mode (IndicatorPowerNotifier * self)
{
priv_t * const p = get_priv (self);
- return (p->accounts_service_sound_proxy != NULL)
- && (dbus_accounts_service_sound_get_silent_mode(p->accounts_service_sound_proxy));
+ /* if we don't have a proxy yet, assume we're in silent mode
+ as a "do no harm" level of response */
+ if (p->accounts_service_sound_proxy == NULL)
+ return TRUE;
+
+ return dbus_accounts_service_sound_get_silent_mode(p->accounts_service_sound_proxy);
}
#endif