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

This commit is contained in:
Tom Moor
2023-08-28 21:02:10 -04:00
parent 30a4303a8e
commit 864ddbd438

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,