X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FIndex.pm;h=74d5329d5cbc376207ae2e527b051c5202fa4f79;hb=82b2e541984df6f697a5a73f2faaa99e40dfc832;hp=2c93c7c55c93bd930d71828759558ca33fc608e3;hpb=a58f1ab4dd5b224b12ed78096b6867f47c316231;p=pr0n diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 2c93c7c..74d5329 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -199,7 +199,9 @@ sub handler { my @files = (); while (my $ref = $q->fetchrow_hashref()) { - push @files, [ $ref->{'event'}, $ref->{'filename'}, $ref->{'width'}, $ref->{'height'} ]; + my $width = defined($ref->{'width'}) ? $ref->{'width'} : -1; + my $height = defined($ref->{'height'}) ? $ref->{'height'} : -1; + push @files, [ $ref->{'event'}, $ref->{'filename'}, $width, $height ]; } for my $i (0..$#files) { @@ -366,7 +368,7 @@ sub handler { } } - if ($ref->{'width'} != -1 && $ref->{'height'} != -1) { + if (defined($ref->{'width'}) && defined($ref->{'height'})) { my $width = $ref->{'width'}; my $height = $ref->{'height'};