Check for NaN before applying styles

This commit is contained in:
tk338g 2021-02-08 01:21:14 +01:00
parent 0a3675e1b9
commit 93d0a56bdb

View File

@ -58,6 +58,15 @@ const MinimapViewport = ({
height + top, height + top,
); );
if (
Number.isNaN(viewportTop) ||
Number.isNaN(viewportLeft) ||
Number.isNaN(viewportWidth) ||
Number.isNaN(viewportHeight)
) {
return null;
}
return ( return (
<div <div
style={{ style={{