Skip to content

Commit

Permalink
Bullet-proofing export scenarios: null attachments, no msgreceiver
Browse files Browse the repository at this point in the history
FREEBIE
  • Loading branch information
scottnonnenberg committed Aug 28, 2017
1 parent c0cd733 commit d31d171
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/background.js
Expand Up @@ -334,7 +334,7 @@
Whisper.events.trigger('reconnectTimer');
} else {
console.log('offline');
messageReceiver.close();
if (messageReceiver) { messageReceiver.close(); }
window.addEventListener('online', init);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion js/backup.js
Expand Up @@ -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);
};
Expand Down

0 comments on commit d31d171

Please sign in to comment.