mirror of
https://github.com/outline/outline.git
synced 2026-11-25 23:24:06 +03:00
fix: Guard missing attachment, closes #1262
This commit is contained in:
1 parent
e1adb16c43
commit
bd2837250b
1 file changed
+4
-2
@@ -18,8 +18,10 @@ async function replaceImageAttachments(text) {
|
||||
|
||||
for (const id of attachmentIds) {
|
||||
const attachment = await Attachment.findByPk(id);
|
||||
const accessUrl = await getSignedImageUrl(attachment.key);
|
||||
text = text.replace(attachment.redirectUrl, accessUrl);
|
||||
if (attachment) {
|
||||
const accessUrl = await getSignedImageUrl(attachment.key);
|
||||
text = text.replace(attachment.redirectUrl, accessUrl);
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
|
||||
Reference in new issue
Block a user