From e1f7a296381473f8faa16e014bb5d4bc4662c590 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Thu, 5 Oct 2023 19:15:15 +0200 Subject: [PATCH] resolves an issue with some datasources --- commands/message/search/wolfram-alpha.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/message/search/wolfram-alpha.js b/commands/message/search/wolfram-alpha.js index 7dfd687..71e7ed5 100644 --- a/commands/message/search/wolfram-alpha.js +++ b/commands/message/search/wolfram-alpha.js @@ -29,6 +29,8 @@ function createWolframPage(context, pod, query, sources){ if(pod.value && pod.refs) { for(const r of pod.refs){ let src = Object.values(sources).filter((s)=>s.ref == r)[0] + if(!src) continue; + // 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)