]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeditem/atom.php
parser: fix failing on empty media:group tags
[tt-rss.git] / classes / feeditem / atom.php
index 244fb1f84671ac61de286ea06ea8441f2e0b4b07..74be03d8031e4957d32ffe82b37d8f811be1126d 100644 (file)
@@ -160,19 +160,21 @@ class FeedItem_Atom extends FeedItem_Common {
 
                        $content = $this->xpath->query("media:content", $enclosure)->item(0);
 
-                       $enc->type = $content->getAttribute("type");
-                       $enc->link = $content->getAttribute("url");
-                       $enc->length = $content->getAttribute("length");
-
-                       $desc = $this->xpath->query("media:description", $content)->item(0);
-                       if ($desc) {
-                               $enc->title = strip_tags($desc->nodeValue);
-                       } else {
-                               $desc = $this->xpath->query("media:description", $enclosure)->item(0);
-                               if ($desc) $enc->title = strip_tags($desc->nodeValue);
-                       }
+                       if ($content) {
+                               $enc->type = $content->getAttribute("type");
+                               $enc->link = $content->getAttribute("url");
+                               $enc->length = $content->getAttribute("length");
+
+                               $desc = $this->xpath->query("media:description", $content)->item(0);
+                               if ($desc) {
+                                       $enc->title = strip_tags($desc->nodeValue);
+                               } else {
+                                       $desc = $this->xpath->query("media:description", $enclosure)->item(0);
+                                       if ($desc) $enc->title = strip_tags($desc->nodeValue);
+                               }
 
-                       array_push($encs, $enc);
+                               array_push($encs, $enc);
+                       }
                }
 
                $enclosures = $this->xpath->query("media:thumbnail", $this->elem);