changeset 253:7410d1005fea

mod_muc_intercom: Fix traceback on topic changes
author Kim Alvefur <zash@zash.se>
date Sun, 26 Sep 2010 18:23:24 +0200 (2010-09-26)
parents 8eae74a31acb
children 1fdd201c1d43
files mod_muc_intercom/mod_muc_intercom.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_intercom/mod_muc_intercom.lua	Mon Sep 20 21:10:49 2010 +0100
+++ b/mod_muc_intercom/mod_muc_intercom.lua	Sun Sep 26 18:23:24 2010 +0200
@@ -19,6 +19,7 @@
 	local from_room, from_host, from_nick = jid.split(from_room_jid);
 
 	local body = stanza:get_child("body");
+	if not body then return; end -- No body, like topic changes
 	body = body and body:get_text(); -- I feel like I want to do `or ""` there :/
 	local target_room, message = body:match("^@([^:]+):(.*)");
 	if not target_room or not message then return; end