a tool for shared writing and social publishing

handle missing preview images

+4 -1
+4 -1
actions/publishToPublication.ts
··· 80 80 let imageMap = new Map<string, BlobRef>(); 81 81 await Promise.all( 82 82 [...links, ...images].map(async (b) => { 83 + if (!b) return; 83 84 let data = await fetch(b.data.src); 84 85 if (data.status !== 200) return; 85 86 let binary = await data.blob(); ··· 268 269 let [description] = scan.eav(b.value, "link/description"); 269 270 let [src] = scan.eav(b.value, "link/url"); 270 271 if (!src) return; 271 - let blobref = imageMap.get(previewImage.data.src); 272 + let blobref = previewImage 273 + ? imageMap.get(previewImage?.data.src) 274 + : undefined; 272 275 let [title] = scan.eav(b.value, "link/title"); 273 276 let block: $Typed<PubLeafletBlocksWebsite.Main> = { 274 277 $type: "pub.leaflet.blocks.website",