From ca539a7a1fefec686939946f4c81c9769a15430b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 6 Feb 2016 18:15:32 +0000 Subject: [PATCH] Prevent crashes --- lib/App/XMMS2/Notifier.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.39.2