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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

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} />;
}