getUUID: Return undefined if uuid is falsey
This commit is contained in:
parent
e0f479ca81
commit
101d53c4ea
2 changed files with 2 additions and 2 deletions
|
@ -3497,7 +3497,7 @@ export class ConversationModel extends window.Backbone
|
||||||
getUuid(): UUID | undefined {
|
getUuid(): UUID | undefined {
|
||||||
try {
|
try {
|
||||||
const value = this.get('uuid');
|
const value = this.get('uuid');
|
||||||
return value && new UUID(value);
|
return value ? new UUID(value) : undefined;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log.warn(
|
log.warn(
|
||||||
`getUuid(): failed to obtain conversation(${this.id}) uuid due to`,
|
`getUuid(): failed to obtain conversation(${this.id}) uuid due to`,
|
||||||
|
|
|
@ -71,7 +71,7 @@ export class User {
|
||||||
`Unsupported uuid kind: ${uuidKind}`
|
`Unsupported uuid kind: ${uuidKind}`
|
||||||
);
|
);
|
||||||
const uuid = this.storage.get('uuid_id');
|
const uuid = this.storage.get('uuid_id');
|
||||||
if (uuid === undefined) return undefined;
|
if (!uuid) return undefined;
|
||||||
return new UUID(Helpers.unencodeNumber(uuid.toLowerCase())[0]);
|
return new UUID(Helpers.unencodeNumber(uuid.toLowerCase())[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue