diff --git a/api/src/channel/lib/Handler.ts b/api/src/channel/lib/Handler.ts index 7e87676d..3d76f47e 100644 --- a/api/src/channel/lib/Handler.ts +++ b/api/src/channel/lib/Handler.ts @@ -309,7 +309,7 @@ export default abstract class ChannelHandler< */ public async getPublicUrl(attachment: AttachmentRef | Attachment) { const [name, _suffix] = this.getName().split('-'); - if ('id' in attachment) { + if (attachment && 'id' in attachment) { if (!attachment || !attachment.id) { this.logger.warn('Unable to build public URL: Empty attachment ID'); return buildURL(config.apiBaseUrl, `/webhook/${name}/not-found`);