From 8217a2bf1486b3d305086fbc8b9a67c48ed6bacc Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Sat, 27 Mar 2021 18:38:12 +0800 Subject: [PATCH] Fix export if never wish on a banner category --- src/functions/export.js | 2 ++ src/functions/wish.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/functions/export.js b/src/functions/export.js index e3560360..90c1dd21 100644 --- a/src/functions/export.js +++ b/src/functions/export.js @@ -147,6 +147,8 @@ async function addWishHistory(workbook, icons) { bold: true, }; + if (data === null) continue; + let groupCount = 0; let lastTime = 0; let lastBanner = ''; diff --git a/src/functions/wish.js b/src/functions/wish.js index 9a0c5c0c..f2a1f8bf 100644 --- a/src/functions/wish.js +++ b/src/functions/wish.js @@ -75,7 +75,11 @@ export function process(id) { }; }); - const { pullData } = readLocalData(path); + const data = readLocalData(path); + + if (data === null) return null; + + const pullData = data.pullData; const currentPulls = []; const allLegendary = [];