plugins/muc/mod_muc: Use module:shared instead of save/restore
[prosody.git] / plugins / mod_saslauth.lua
index 4513c511d68d164070438aa05120f93b005e7972..94c060b30f6ca414f042c7bacca44056fdd77342 100644 (file)
@@ -245,7 +245,7 @@ module:hook("stream-features", function(event)
                if origin.encrypted then
                        -- check wether LuaSec has the nifty binding to the function needed for tls-unique
                        -- FIXME: would be nice to have this check only once and not for every socket
-                       if origin.conn:socket().getpeerfinished then
+                       if origin.conn:socket().getpeerfinished and origin.sasl_handler.add_cb_handler then
                                origin.sasl_handler:add_cb_handler("tls-unique", function(self)
                                        return self.userdata:getpeerfinished();
                                end);