diff --git a/js/background.js b/js/background.js index 20ec8003f..f1a80de6f 100644 --- a/js/background.js +++ b/js/background.js @@ -700,7 +700,7 @@ return; } - const nullAvatar = ''; + const nullAvatar = undefined; if (avatar) { // would get to download this file on each client in the group // and reference the local file @@ -831,7 +831,7 @@ recipients: allMembers, active: true, expireTimer: 0, - avatar: '', + avatar: undefined, }, confirm: () => {}, }; diff --git a/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts b/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts index 612f69eee..0664a0516 100644 --- a/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts +++ b/ts/session/messages/outgoing/content/data/group/ClosedGroupUpdateMessage.ts @@ -43,6 +43,13 @@ export abstract class ClosedGroupUpdateMessage extends ClosedGroupMessage { throw new Error('admins has not the correct type'); } + if ( + params.avatar !== undefined && + !(params.avatar instanceof SignalService.AttachmentPointer) + ) { + throw new Error('avatar has not the correct type'); + } + this.name = params.name; this.members = params.members; this.admins = params.admins;