From a977927a56dd00a65e61f5a78734eba6319aa42f Mon Sep 17 00:00:00 2001 From: Wizzard Date: Fri, 22 Mar 2024 20:41:39 -0400 Subject: [PATCH] Handle token not having imageurl --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 84570a9..a3c48f2 100644 --- a/main.js +++ b/main.js @@ -277,9 +277,11 @@ const checkStatusAndUpdateOBS = async () => { if (response.data.pairs && response.data.pairs.length > 0) { const pair = response.data.pairs[0]; + const defaultImageUrl = "https://etc.worldhistory.org/wp-content/uploads/2014/12/IMG_3573-888x1024.jpg"; + const tokenData = { name: pair.baseToken.name, - imageUrl: pair.info.imageUrl, + imageUrl: pair.info && pair.info.imageUrl ? pair.info.imageUrl : defaultImageUrl, symbol: pair.baseToken.symbol, marketCap: pair.fdv, price: pair.priceUsd,