From d31d1712b18e023dd445087f324843cf9517c627 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 28 Aug 2017 13:20:53 -0700 Subject: [PATCH] Bullet-proofing export scenarios: null attachments, no msgreceiver FREEBIE --- js/background.js | 2 +- js/backup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 3b79136f4..747408961 100644 --- a/js/background.js +++ b/js/background.js @@ -334,7 +334,7 @@ Whisper.events.trigger('reconnectTimer'); } else { console.log('offline'); - messageReceiver.close(); + if (messageReceiver) { messageReceiver.close(); } window.addEventListener('online', init); } return; diff --git a/js/backup.js b/js/backup.js index eafd0ff48..d7e584c59 100644 --- a/js/backup.js +++ b/js/backup.js @@ -369,7 +369,7 @@ var jsonString = JSON.stringify(stringify(message)); stream.write(jsonString); - if (attachments.length) { + if (attachments && attachments.length) { var process = function() { return writeAttachments(dir, name, messageId, attachments); };