fix: extra check

This commit is contained in:
Mohamed Marrouchi 2025-05-12 14:33:08 +01:00
parent 5ddc257492
commit 72c9484ff6

View File

@ -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`);