From 93d0a56bdb6602f9b25c98eae7229cad2377cdc7 Mon Sep 17 00:00:00 2001 From: tk338g Date: Mon, 8 Feb 2021 01:21:14 +0100 Subject: [PATCH] Check for NaN before applying styles --- src/components/MiniMap.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/MiniMap.tsx b/src/components/MiniMap.tsx index 7f3bb9dfb..02e103588 100644 --- a/src/components/MiniMap.tsx +++ b/src/components/MiniMap.tsx @@ -58,6 +58,15 @@ const MinimapViewport = ({ height + top, ); + if ( + Number.isNaN(viewportTop) || + Number.isNaN(viewportLeft) || + Number.isNaN(viewportWidth) || + Number.isNaN(viewportHeight) + ) { + return null; + } + return (