From 936bf8df9d8ce1f694765daf3a5fddbbfbb7dd3c Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 31 May 2017 18:08:41 +0200 Subject: [PATCH] return falsey if userHash is junk --- www/common/cryptpad-common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 1576275c7..93dc1a4fc 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -246,10 +246,10 @@ define([ var getUserHash = common.getUserHash = function () { var hash = localStorage[userHashKey]; - if (hash && ['undefined', 'undefined/'].indexOf(hash) !== -1) { + if (hash && ['undefined', 'undefined/'].indexOf(hash) === -1) { var sHash = common.serializeHash(hash); if (sHash !== hash) { localStorage[userHashKey] = sHash; } - } + } else { return; } return hash; };