Add missing validity check to device storage

This commit is contained in:
Matt Corallo 2015-01-18 11:34:11 -10:00 committed by lilia
parent 30dd13e8e3
commit bfb3e7751e

View file

@ -75,7 +75,7 @@
};
var internalSaveDeviceObject = function(deviceObject, onlyKeys) {
if (deviceObject.identityKey === undefined || deviceObject.encodedNumber === undefined)
if (deviceObject.identityKey === undefined || deviceObject.encodedNumber === undefined || deviceObject.registrationId === undefined)
throw new Error("Tried to store invalid deviceObject");
var number = textsecure.utils.unencodeNumber(deviceObject.encodedNumber)[0];