From 39a6dbcc84aea436c140e90c3947ff9424097b03 Mon Sep 17 00:00:00 2001 From: Ash Monty Date: Wed, 6 Jul 2022 14:35:53 +0200 Subject: [PATCH] fix(trello): return placeholder if cache is undefined --- src/trello.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/trello.js b/src/trello.js index cd8e6f9..8f01ee0 100644 --- a/src/trello.js +++ b/src/trello.js @@ -9,7 +9,19 @@ let cache; async function getTrelloCache() { const available = await trelloAPIAvailable(); if (!available) { - return cache; + return cache || { + update_time: 0, + sections: [{ + title: 'Upstream API error', + id: '', + percentage_complete: '', + progress: { + not_started: [ 'Trello API unavailable' ], + started: [], + completed: [] + } + }], + }; } if (!cache) {