Bullet-proofing export scenarios: null attachments, no msgreceiver
FREEBIE
This commit is contained in:
parent
c0cd733139
commit
d31d1712b1
2 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@
|
||||||
Whisper.events.trigger('reconnectTimer');
|
Whisper.events.trigger('reconnectTimer');
|
||||||
} else {
|
} else {
|
||||||
console.log('offline');
|
console.log('offline');
|
||||||
messageReceiver.close();
|
if (messageReceiver) { messageReceiver.close(); }
|
||||||
window.addEventListener('online', init);
|
window.addEventListener('online', init);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -369,7 +369,7 @@
|
||||||
var jsonString = JSON.stringify(stringify(message));
|
var jsonString = JSON.stringify(stringify(message));
|
||||||
stream.write(jsonString);
|
stream.write(jsonString);
|
||||||
|
|
||||||
if (attachments.length) {
|
if (attachments && attachments.length) {
|
||||||
var process = function() {
|
var process = function() {
|
||||||
return writeAttachments(dir, name, messageId, attachments);
|
return writeAttachments(dir, name, messageId, attachments);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue