Permalink
Browse files

throw an error if cl.ly has no image

  • Loading branch information...
1 parent 721c74c commit 55ca9ca8cc8275d1d944f0ff1720639547bc7b5f @leedo committed Apr 7, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Noembed/Source/CloudApp.pm
View
4 lib/Noembed/Source/CloudApp.pm
@@ -18,7 +18,9 @@ sub patterns { 'http://cl\.ly/[0-9a-zA-Z]+/?$' }
sub image_data {
my ($self, $body) = @_;
- $self->{scraper}->scrape($body);
+ $data = $self->{scraper}->scrape($body);
+ die "no image found" unless $data->{src};
+ return $data;
}
1;

0 comments on commit 55ca9ca

Please sign in to comment.