mod_tls: Cleanup.
[prosody.git] / plugins / mod_register.lua
index bda40124fc88de44724e22a9d8619375dec604b8..be1be0aebecb1dca7c28a74df66e74af49ff8c90 100644 (file)
@@ -141,7 +141,7 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s
                                        username = nodeprep(table.concat(username));
                                        password = table.concat(password);
                                        local host = module.host;
-                                       if not username then
+                                       if not username or username == "" then
                                                session.send(st.error_reply(stanza, "modify", "not-acceptable", "The requested username is invalid."));
                                        elseif usermanager_user_exists(username, host) then
                                                session.send(st.error_reply(stanza, "cancel", "conflict", "The requested username already exists."));