]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix check for nonexistant content
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 17 Sep 2008 22:19:52 +0000 (18:19 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 17 Sep 2008 22:19:52 +0000 (18:19 -0400)
IkiWiki/Plugin/aggregate.pm

index f47dc58b3f67e598843ace5d1d429e71c2e76ae8..2b40625dbd70bb9fe0da0c271d365948a83619b8 100644 (file)
@@ -520,10 +520,10 @@ sub aggregate (@) { #{{{
                }
 
                foreach my $entry ($f->entries) {
-                       my $content=$content=$entry->content;
+                       my $content=$content=$entry->content->body;
                        # atom feeds may have no content, only a summary
-                       if (! defined $content) {
-                               $content=$entry->summary;
+                       if (! defined $content && ref $entry->summary) {
+                               $content=$entry->summary->body;
                        }
 
                        add_page(
@@ -531,7 +531,7 @@ sub aggregate (@) { #{{{
                                copyright => $f->copyright,
                                title => defined $entry->title ? decode_entities($entry->title) : "untitled",
                                link => $entry->link,
-                               content => defined $content ? $content->body : "",
+                               content => defined $content ? $content : "",
                                guid => defined $entry->id ? $entry->id : time."_".$feed->{name},
                                ctime => $entry->issued ? ($entry->issued->epoch || time) : time,
                        );