diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 4f8f69a1b..d9fbf8acf 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -578,7 +578,7 @@ define([ } var parsed = Hash.parsePadUrl(window.location.href); if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); } - if (parsed.type === 'file') { secret.channel = Util.base64ToHex(secret.channel); } + if (parsed.type === 'file' && typeof(parsed.channel) === 'string') { secret.channel = Util.base64ToHex(secret.channel); } hashes = Hash.getHashes(secret); if (secret.version === 0) { diff --git a/www/common/outer/userObject.js b/www/common/outer/userObject.js index be718562c..b24092673 100644 --- a/www/common/outer/userObject.js +++ b/www/common/outer/userObject.js @@ -588,6 +588,7 @@ define([ if (!el.title) { el.title = Hash.getDefaultName(parsed); } // Fix channel if (!el.channel) { + try { if (parsed.hashData && parsed.hashData.type === "file") { // PASSWORD_FILES el.channel = Util.base64ToHex(parsed.hashData.channel); @@ -596,6 +597,9 @@ define([ el.channel = secret.channel; } console.log('Adding missing channel in filesData ', el.channel); + } catch (e) { + console.error(e); + } } if ((loggedIn || config.testMode) && rootFiles.indexOf(id) === -1) {