Diff

plugins/muc/muc.lib.lua @ 3506:0f46acca11cc

MUC: Fixed traceback on presence errors lacking a condition.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 27 Sep 2010 19:00:11 +0500
parent 3446:9c0b3cd890e9
child 3509:72cb8b6536b9
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Tue Sep 21 18:28:06 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Mon Sep 27 19:00:11 2010 +0500
@@ -243,7 +243,7 @@
 
 local function build_unavailable_presence_from_error(stanza)
 	local type, condition, text = stanza:get_error();
-	local error_message = "Kicked: "..condition:gsub("%-", " ");
+	local error_message = "Kicked: "..(condition and condition:gsub("%-", " ") or "presence error");
 	if text then
 		error_message = error_message..": "..text;
 	end