fix: Do not attempt to download non-valid urls in document create/import

This commit is contained in:
Tom Moor committed 2023-08-28 21:02:10 -04:00
1 parent 30a4303a8e
commit 864ddbd438
1 file changed
+7
+7
View File
@@ -381,6 +381,13 @@ export default class DocumentHelper {
await Promise.all(
images.map(async (image) => {
// Skip attempting to fetch images that are not valid urls
try {
new URL(image.src);
} catch {
return;
}
const attachment = await attachmentCreator({
name: image.alt ?? "image",
url: image.src,