fix edge case with empty source collections

This commit is contained in:
bignutty 2025-05-09 17:06:05 +02:00
parent dfde49a555
commit e4cb3a8030
2 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ function createWolframPage(context, pod, query, sources) {
// Only add a direct source if one is available
if (src.collections) {
res.embeds[0].description += citation(r, src.url, src.title + ' | ' + src.collections[0].text)
res.embeds[0].description += citation(r, src.url, src.title + (src.collections[0] ? ' | ' + src.collections[0].text : ""))
continue;
}
if (src.url) res.embeds[0].description += citation(r, src.url, src.title)