]> iEval git - app-xmms2-notifier.git/commitdiff
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 f61a74aee26ddb10934cc2e0ddd329d27a691b3f..3ce6645126aa158621a51fca498506476e8dd579 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.020181 seconds and 4 git commands to generate.