Skip to content

Commit 37af097

Browse files
committed
Merge pull request #9 from gugod/master
Some sanity checks to prevent dying on aggregation.
2 parents b28528d + fbc0674 commit 37af097

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Plagger/Plugin/Namespace/MediaRSS.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ sub handle {
2020
$content = [ $content ] unless ref $content && ref $content eq 'ARRAY';
2121

2222
for my $media_content (@{$content}) {
23+
next unless ref($media_content) eq 'HASH' && exists($media_content->{url}) && exists($media_content->{type});
2324
my $enclosure = Plagger::Enclosure->new;
2425
$enclosure->url( URI->new($media_content->{url}) );
2526
$enclosure->auto_set_type($media_content->{type});
@@ -31,7 +32,7 @@ sub handle {
3132
url => $thumbnail->{url},
3233
width => $thumbnail->{width},
3334
height => $thumbnail->{height},
34-
});
35+
}) if ref($thumbnail) eq 'HASH';
3536
}
3637
}
3738

0 commit comments

Comments
 (0)