From: Marius Gavrilescu Date: Sat, 6 Feb 2016 18:15:32 +0000 (+0000) Subject: Prevent crashes X-Git-Tag: 0.001002~3 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=ca539a7a1fefec686939946f4c81c9769a15430b;p=app-xmms2-notifier.git Prevent crashes --- diff --git a/lib/App/XMMS2/Notifier.pm b/lib/App/XMMS2/Notifier.pm index f61a74a..3ce6645 100644 --- a/lib/App/XMMS2/Notifier.pm +++ b/lib/App/XMMS2/Notifier.pm @@ -25,8 +25,11 @@ sub notify_libnotify{ } sub notify{ - my $id=$xmms->playback_current_id->wait->value or return; - my $minfo=$xmms->medialib_get_info($id)->wait->value; + my ($id, $minfo); + eval { + $id=$xmms->playback_current_id->wait->value or return; + $minfo=$xmms->medialib_get_info($id)->wait->value; + } or return; my %metadata = map { $_ => exists $minfo->{$_} ? (values $minfo->{$_})[0] : undef } CONVERSION_SPECIFIERS; my $str=$format;