From: Ralf Ertzinger Date: Sun, 27 Apr 2008 21:10:45 +0000 (+0200) Subject: - Check for existance of field before using it X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=7f8669fc619a87e496066fb6f92f3df127e985c5;p=videosite.git - Check for existance of field before using it --- diff --git a/videosite/CollegeHumorGrabber.pm b/videosite/CollegeHumorGrabber.pm index 3bda5dd..b25043c 100644 --- a/videosite/CollegeHumorGrabber.pm +++ b/videosite/CollegeHumorGrabber.pm @@ -78,7 +78,7 @@ sub _parse { # Look for the title in the meta tags foreach $t (@accum) { if ('meta' eq $t->[0]) { - if ('title' eq $t->[1]->{'name'}) { + if (exists($t->[1]->{'name'}) and ('title' eq $t->[1]->{'name'})) { $metadata->{'TITLE'} = $t->[1]->{'content'}; } }