# HG changeset patch
# User Lance Stout <lancestout@gmail.com>
# Date 1442520129 25200
# Node ID 9019bc4c9a5a73e2ce0fff3f53412c82ce416b3c
# Parent  19c4532946b36ca044eae8ec17bcccabc9bf10a9
MUC: Prevent double replies when MUC affiliation/role change requests fail.

diff -r 19c4532946b3 -r 9019bc4c9a5a plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Tue Sep 15 19:39:57 2015 +0200
+++ b/plugins/muc/muc.lib.lua	Thu Sep 17 13:02:09 2015 -0700
@@ -747,8 +747,11 @@
 	else
 		success, errtype, err = nil, "cancel", "bad-request";
 	end
-	if not success then origin.send(st.error_reply(stanza, errtype, err)); end
-	origin.send(st.reply(stanza));
+	if not success then
+		origin.send(st.error_reply(stanza, errtype, err));
+	else
+		origin.send(st.reply(stanza));
+	end
 	return true;
 end