From 307651ab24877b31aba54cc2741c318bf7b705e4 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Sat, 16 Jan 2021 13:31:27 -0500 Subject: Patch failure for one-week current semester --- src/MainPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/MainPage.js') diff --git a/src/MainPage.js b/src/MainPage.js index ae9c5a9..8e8bc22 100644 --- a/src/MainPage.js +++ b/src/MainPage.js @@ -6,7 +6,7 @@ const MainPage = (props) => { const data = props.data; const latest = data[data.length - 1]; const prior = data[data.length - (1 + props.timeDifference)]; - const priorPrior = data[data.length - (1 + props.timeDifference * 2)]; + const priorPrior = data[Math.max(0, data.length - (1 + props.timeDifference * 2))]; const positiveTestRate = Math.max( 0, -- cgit v1.2.3