From bfb3e7751e1020c5d4f13413e7dfffe85c281ba5 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 18 Jan 2015 11:34:11 -1000 Subject: [PATCH] Add missing validity check to device storage --- libtextsecure/storage/devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtextsecure/storage/devices.js b/libtextsecure/storage/devices.js index 2fd86e7d..876cd8b7 100644 --- a/libtextsecure/storage/devices.js +++ b/libtextsecure/storage/devices.js @@ -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];