Handle the case in MPD if there is no status returned.
authorAndrew Ruthven <puck@catalyst.net.nz>
Sun, 21 Sep 2008 21:41:03 +0000 (09:41 +1200)
committerAndrew Ruthven <puck@dirk.wgtn.cat-it.co.nz>
Sun, 21 Sep 2008 21:41:03 +0000 (09:41 +1200)
lib/Display/Plugins/MPD.pm

index e9b9b08..8a7362d 100644 (file)
@@ -27,7 +27,7 @@ sub display {
 
   my $current = $self->{'mpd'}->current();
 
-  if ($self->{'file'} ne $current->file()) {
+  if (defined $current && $self->{'file'} ne $current->file()) {
     my @lines = ();
     push @lines, $current->title()  if defined $current->title();
     push @lines, $current->album()  if defined $current->album();