# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1531596419 -7200
# Node ID 18cd5102253c0317e10b53bb7c38601684591e2b
# Parent  9d77b6588bdf49dcf862001a7b5efe5f4ffff32d
mod_pubsub: Skip checks for adding body if no body generated

diff -r 9d77b6588bdf -r 18cd5102253c plugins/mod_pubsub/mod_pubsub.lua
--- a/plugins/mod_pubsub/mod_pubsub.lua	Sat Jul 14 21:26:13 2018 +0200
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Sat Jul 14 21:26:59 2018 +0200
@@ -70,7 +70,7 @@
 
 	for jid, options in pairs(jids) do
 		local new_stanza = st.clone(message);
-		if type(options) == "table" and options["pubsub#include_body"] then
+		if summary and type(options) == "table" and options["pubsub#include_body"] then
 			new_stanza:body(summary);
 		end
 		new_stanza.attr.to = jid;