Index: video_upload.admin.inc
===================================================================
retrieving revision 1.5.2.6
diff -u -r1.5.2.6 video_upload.admin.inc
--- video_upload.admin.inc	4 Sep 2009 20:51:16 -0000	1.5.2.6
+++ video_upload.admin.inc	3 Mar 2010 10:12:16 -0000
@@ -406,21 +406,20 @@
   //        that are not yet published.  A much more efficient and sane
   //        method would be to only look up the videos on which we don't
   //        have a status
-  $feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection);
+  if ($feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection)) {
+    foreach ($feed as $video) {
+      if (!in_array($video->getVideoId(), $video_ids)) {
+        continue;
+      }
+      // Load the node in question.
+      $local_video = $videos[$video->getVideoId()];
+      $node = node_load(array('nid' => $local_video->nid));
+      _video_upload_update_video_remote($connection, $video, $local_video, $node);
 
-  foreach ($feed as $video) {
-    if (!in_array($video->getVideoId(), $video_ids)) {
-      continue;
+      // The video may have been updated, thus the status may have changed.
+      _video_upload_node_set_video_status($local_video);
     }
-    // Load the node in question.
-    $local_video = $videos[$video->getVideoId()];
-    $node = node_load(array('nid' => $local_video->nid));
-    _video_upload_update_video_remote($connection, $video, $local_video, $node);
-
-    // The video may have been updated, thus the status may have changed.
-    _video_upload_node_set_video_status($local_video);
   }
-
 }
 
 /**
@@ -452,19 +451,19 @@
   //   Unfortunately, this is currently the only way to check on videos that
   //   are not yet published.  A much more efficient and sane method would be
   //   to only look up the videos on which we don't have a status.
-  $feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection);
-
-  foreach ($feed as $video) {
-    if (!in_array($video->getVideoId(), $video_ids)) {
-      continue;
+  if ($feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection)) {
+    foreach ($feed as $video) {
+      if (!in_array($video->getVideoId(), $video_ids)) {
+        continue;
+      }
+
+      // Delete the video from the provider.
+      _video_upload_delete_video_remote($connection, $video);
+
+      // Remove record from local table.
+      $local_video = $videos[$video->getVideoId()];
+      video_upload_delete_local($local_video);
     }
-
-    // Delete the video from the provider.
-    _video_upload_delete_video_remote($connection, $video);
-
-    // Remove record from local table.
-    $local_video = $videos[$video->getVideoId()];
-    video_upload_delete_local($local_video);
   }
 }
 
@@ -492,4 +491,4 @@
   $multiple = $config['multiple'] ? ', delta' : '';
   return db_query("SELECT %s AS video_id, nid, %s AS fid, %s AS video_status" . $multiple . " FROM {" . $db_info['table'] . "} t WHERE %s = '%s' AND %s IS NOT NULL", $params);
 }
-  
\ No newline at end of file
+  
