Use `null`, not `"null"`, if `sessionID` cookie doesn't exist

`decodeURIComponent(null)` returns the string `'null'`, which we don't
want.
pull/4285/head
Richard Hansen 2020-09-10 18:54:06 -04:00 committed by John McLear
parent 24978daeb0
commit ed3c82e8c3
1 changed files with 2 additions and 1 deletions

View File

@ -156,7 +156,8 @@ function sendClientReady(isReconnect, messageType)
createCookie("token", token, 60);
}
var sessionID = decodeURIComponent(readCookie("sessionID"));
var encodedSessionID = readCookie('sessionID');
var sessionID = encodedSessionID == null ? null : decodeURIComponent(encodedSessionID);
var password = readCookie("password");
var msg = {