- Check for existance of hash key before using
[videosite.git] / videosite / YouTubeGrabber.pm
index 701a578..f4bac10 100644 (file)
@@ -100,7 +100,7 @@ sub _parse {
                 $self->debug('URL found: %s', $metadata->{'DLURL'});
             }
         } elsif ('div' eq $tag->[0]) {
-            if ('errorBox' eq $tag->[1]->{'class'}) {
+            if (exists($tag->[1]->{'class'}) and ('errorBox' eq $tag->[1]->{'class'})) {
                 $self->error("Could not get video data for youtube %s: %s",
                         $metadata->{'ID'}, $p->get_trimmed_text());
                 return undef;