Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

in examples/chat, don't allow null nicknames #865

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+2 −2
Split
View
@@ -60,7 +60,7 @@ io.sockets.on('connection', function (socket) {
});
socket.on('nickname', function (nick, fn) {
- if (nicknames[nick]) {
+ if (!nick.length || nicknames[nick]) {
fn(true);
} else {
fn(false);
View
@@ -72,7 +72,7 @@ html
form.wrap#set-nickname
p Please type in your nickname and press enter.
input#nick
- p#nickname-err Nickname already in use
+ p#nickname-err Nickname already in use or not entered
#connecting
.wrap Connecting to socket.io server
#messages