MUC: Fixed traceback on presence errors lacking a condition.
authorWaqas Hussain <waqas20@gmail.com>
Mon, 27 Sep 2010 19:00:11 +0500
changeset 3506 0f46acca11cc
parent 3505 eb2f36dc0369
child 3509 72cb8b6536b9
MUC: Fixed traceback on presence errors lacking a condition.
plugins/muc/muc.lib.lua
--- 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