explorer: block query should be strictly integers (#15442)

This commit is contained in:
Josh
2021-02-19 10:37:39 -08:00
committed by GitHub
parent 5548e599fe
commit 58b35db384

View File

@ -12,7 +12,11 @@ export function BlockDetailsPage({ slot }: Props) {
const slotNumber = Number(slot);
let output = <ErrorCard text={`Block ${slot} is not valid`} />;
if (!isNaN(slotNumber) && slotNumber < MAX_SAFE_INTEGER) {
if (
!isNaN(slotNumber) &&
slotNumber < MAX_SAFE_INTEGER &&
slotNumber % 1 === 0
) {
output = <BlockOverviewCard slot={slotNumber} />;
}