Ensure encrypting device name does not die on empty device name (#3066)
Ran into this on the Contributors guidelines setting up the development env. registerSingleDevice does not pass a deviceName, so it fail every time.
This commit is contained in:
parent
a28f4a9187
commit
f968a5db3d
2 changed files with 8 additions and 0 deletions
|
@ -47,6 +47,9 @@
|
|||
return this.server.requestVerificationSMS(number);
|
||||
},
|
||||
async encryptDeviceName(name, providedIdentityKey) {
|
||||
if (!name) {
|
||||
return null;
|
||||
}
|
||||
const identityKey =
|
||||
providedIdentityKey ||
|
||||
(await textsecure.storage.protocol.getIdentityKeyPair());
|
||||
|
|
|
@ -38,6 +38,11 @@ describe('AccountManager', () => {
|
|||
|
||||
assert.strictEqual(decrypted, deviceName);
|
||||
});
|
||||
|
||||
it('handles null deviceName', async () => {
|
||||
const encrypted = await accountManager.encryptDeviceName(null);
|
||||
assert.strictEqual(encrypted, null);
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps three confirmed keys even if over a week old', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue