From: Andrew Ruthven Date: Sun, 21 Sep 2008 21:41:03 +0000 (+1200) Subject: Handle the case in MPD if there is no status returned. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb33d08107b06c94638171ec42977e527a061b9b;p=picture-display.git Handle the case in MPD if there is no status returned. --- diff --git a/lib/Display/Plugins/MPD.pm b/lib/Display/Plugins/MPD.pm index e9b9b08..8a7362d 100644 --- a/lib/Display/Plugins/MPD.pm +++ b/lib/Display/Plugins/MPD.pm @@ -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();