Prevent crashes
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 6 Feb 2016 18:15:32 +0000 (18:15 +0000)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 6 Feb 2016 18:15:32 +0000 (18:15 +0000)
lib/App/XMMS2/Notifier.pm

index f61a74a..3ce6645 100644 (file)
@@ -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;
This page took 0.976248 seconds and 4 git commands to generate.