summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--notify.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/notify.pl b/notify.pl
index fa40e99..bd00c3d 100644
--- a/notify.pl
+++ b/notify.pl
@@ -27,8 +27,11 @@ Irssi::settings_add_str('notify', 'notify_time', '5000');
sub notify {
my ($server, $summary, $message) = @_;
my $bus = Net::DBus->session;
+ return if (!$bus);
my $svc = $bus->get_service("org.freedesktop.Notifications");
+ return if (!$svc);
my $obj = $svc->get_object("/org/freedesktop/Notifications");
+ return if (!$obj);
# Make the message entity-safe. This is all a crappy hack and I'd
# love to know a Perl-ish way to do this properly.