Add missing validity check to device storage

This commit is contained in:
Matt Corallo
2015-02-12 15:12:00 -08:00
committed by lilia
parent 30dd13e8e3
commit bfb3e7751e
+1 -1
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];