mod_pubsub_summary/mod_pubsub_summary.lua
changeset 4511 86a97e7572b2
parent 4442 2bb11055e4bb
child 4517 ade2064160e3
--- a/mod_pubsub_summary/mod_pubsub_summary.lua	Tue Mar 09 18:44:35 2021 +0100
+++ b/mod_pubsub_summary/mod_pubsub_summary.lua	Fri Mar 12 11:00:26 2021 +0100
@@ -7,8 +7,8 @@
 	-- Note: This prefers content over summary, it was made for a news feed where
 	-- the interesting stuff was in the content and the summary was .. meh.
 	local content_tag = payload:get_child("content") or payload:get_child("summary");
-	local content = content_tag:get_text();
-	if content_tag.attr.type == "html" then
+	local content = content_tag and content_tag:get_text();
+	if content and content_tag.attr.type == "html" then
 		content = content:gsub("\n*<p[^>]*>\n*(.-)\n*</p>\n*", "%1\n\n");
 		content = content:gsub("<li>(.-)</li>\n", "* %1\n");
 		content = content:gsub("<a[^>]*href=[\"'](.-)[\"'][^>]*>(.-)</a>", "%2 <%1>");