Throw exception on bad args to SyncRequest

// FREEBIE
This commit is contained in:
lilia 2016-01-14 15:57:38 -08:00
parent 1b68e652cc
commit d6da77b6f4
2 changed files with 6 additions and 0 deletions

View file

@ -37718,6 +37718,9 @@ textsecure.MessageSender.prototype = {
window.textsecure = window.textsecure || {};
function SyncRequest(sender, receiver) {
if (!(sender instanceof MessageSender) || !(receiver instanceof MessageReceiver)) {
throw new Error('Tried to construct a SyncRequest without MessageSender and MessageReceiver');
}
this.receiver = receiver;
this.oncontact = this.onContactSyncComplete.bind(this);

View file

@ -8,6 +8,9 @@
window.textsecure = window.textsecure || {};
function SyncRequest(sender, receiver) {
if (!(sender instanceof MessageSender) || !(receiver instanceof MessageReceiver)) {
throw new Error('Tried to construct a SyncRequest without MessageSender and MessageReceiver');
}
this.receiver = receiver;
this.oncontact = this.onContactSyncComplete.bind(this);