From 1d63419df83a0edf2c6d3595d5c6b003dbe1c18d Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 2 Oct 2018 11:31:08 -0400 Subject: [PATCH] update error handling, but leave the note to come back --- www/common/cryptpad-common.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 84e7d1a01..0c62084db 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1373,9 +1373,11 @@ define([ console.log('Posting CONNECT'); postMessage('CONNECT', cfg, function (data) { - // XXX validate that data exists, probably return otherwise. + // XXX data should always exist + // this indicates a false condition in sharedWorker // got here via a reference error: // uncaught exception: TypeError: data is undefined + if (!data) { throw new Error('FALSE_INIT'); } if (data.error) { throw new Error(data.error); } if (data.state === 'ALREADY_INIT') { data = data.returned;