Index: mythvideo/mythvideo/scripts/tmdb.pl
===================================================================
--- mythvideo/mythvideo/scripts/tmdb.pl	(revision 20310)
+++ mythvideo/mythvideo/scripts/tmdb.pl	(working copy)
@@ -119,6 +119,11 @@
     my ($rc, $response) =
         TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"});
 
+    if (!defined $response) {
+        die "Unable to contact themoviedb.org while retrieving ".
+            "movie data, stopped";
+    }
+
     my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'],
         KeyAttr => []);
     my $xml = $xs->XMLin($response);
@@ -130,6 +135,11 @@
         my ($rc, $response) =
             TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});
 
+        if (!defined $response) {
+            die "Unable to contact themoviedb.org while retrieving ".
+                "movie data, stopped";
+        }
+
         $xml = $xs->XMLin($response,
             ForceArray => ['category', 'production_countries'],
             KeyAttr => ['key', 'id']);
@@ -235,6 +245,11 @@
     my ($rc, $response) =
         TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"});
 
+    if (!defined $response) {
+        die "Unable to contact themoviedb.org while retrieving ".
+            "movie poster, stopped";
+    }
+
     my $xml = XMLin($response, ForceArray => ['movie', 'poster', 'backdrop'],
         KeyAttr => {poster => 'size'});
 
@@ -258,6 +273,11 @@
     my ($rc, $response) =
         TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"});
 
+    if (!defined $response) {
+        die "Unable to contact themoviedb.org while retrieving ".
+            "movie backdrop, stopped";
+    }
+
     my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => [],
         KeyAttr => []);
     my $xml = $xs->XMLin($response);
@@ -270,6 +290,11 @@
         my ($rc, $response) =
             TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});
 
+        if (!defined $response) {
+            die "Unable to contact themoviedb.org while retrieving ".
+                "movie backdrop, stopped";
+        }
+
         $xml = XMLin($response, ForceArray=> [], KeyAttr => ['key', 'id']);
 
         foreach my $backdrop (@{$xml->{moviematches}->{movie}->{backdrop}}) {
@@ -299,6 +324,11 @@
     my ($rc, $response) =
         TMDBAPIRequest('Movie.search', {'title' => $query});
 
+    if (!defined $response) {
+        die "Unable to contact themoviedb.org while retrieving ".
+            "movie list, stopped";
+    }
+
     my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'],
         KeyAttr => []);
     my $xml = $xs->XMLin($response);
