From 42b6cca18d45acdc60a91e8f3f0d847f3ba2f6d9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 24 Feb 2017 16:55:43 +0100 Subject: [PATCH] Fix new pad not working --- www/common/cryptpad-common.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index c32ebbe10..b2be4f5a1 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -583,12 +583,14 @@ define([ // STORAGE var isNotStrongestStored = common.isNotStrongestStored = function (href, recents) { var parsed = parsePadUrl(href); + if (!parsed.hash) { return false; } return recents.some(function (pad) { var p = parsePadUrl(pad.href); if (p.type !== parsed.type) { return false; } // Not the same type if (p.hash === parsed.hash) { return false; } // Same hash, not stronger var pHash = parseHash(p.hash); var parsedHash = parseHash(parsed.hash); + if (!parsedHash || !pHash) { return; } if (pHash.version !== parsedHash.version) { return false; } if (pHash.channel !== parsedHash.channel) { return false; } if (pHash.mode === 'edit' && parsedHash.mode === 'view') { return true; }