Avoid crash in processing incoming message if timestamp is null

This commit is contained in:
Scott Nonnenberg 2019-05-29 14:33:50 -07:00
parent 9375300691
commit 058feb317c

View file

@ -1305,6 +1305,10 @@ MessageReceiver.prototype.extend({
// fields after the first action.
if (window.TIMESTAMP_VALIDATION) {
if (!envelope.timestamp || !decrypted.timestamp) {
throw new Error('Missing timestamp on dataMessage or envelope');
}
const envelopeTimestamp = envelope.timestamp.toNumber();
const decryptedTimestamp = decrypted.timestamp.toNumber();