diff --git a/packages/ui-react-rx/src/util/isTestChain.ts b/packages/ui-react-rx/src/util/isTestChain.ts index 2dd0f879ce..c8a58e83d6 100644 --- a/packages/ui-react-rx/src/util/isTestChain.ts +++ b/packages/ui-react-rx/src/util/isTestChain.ts @@ -7,7 +7,7 @@ import isUndefined from '@polkadot/util/is/undefined'; const re = new RegExp('(dev|loc)', 'i'); export default function isTestChain (chain?: string): boolean { - if (isUndefined(chain)) { + if (isUndefined(chain) || chain === null) { return false; } diff --git a/packages/ui-react-rx/src/util/numberFormat.ts b/packages/ui-react-rx/src/util/numberFormat.ts index c6431e967e..44173b3422 100644 --- a/packages/ui-react-rx/src/util/numberFormat.ts +++ b/packages/ui-react-rx/src/util/numberFormat.ts @@ -7,7 +7,7 @@ import BN from 'bn.js'; const NUMBER_REGEX = new RegExp('(\\d+?)(?=(\\d{3})+(?!\\d)|$)', 'g'); export default function numberFormat (value?: BN | number): string { - if (value === undefined) { + if (value === undefined || value === null) { return '0'; } diff --git a/packages/ui-react-rx/src/util/shouldUseLatestChain.ts b/packages/ui-react-rx/src/util/shouldUseLatestChain.ts index 376fa5fd01..af15aa1b10 100644 --- a/packages/ui-react-rx/src/util/shouldUseLatestChain.ts +++ b/packages/ui-react-rx/src/util/shouldUseLatestChain.ts @@ -7,7 +7,7 @@ import isUndefined from '@polkadot/util/is/undefined'; const re = new RegExp('(poc-1)', 'i'); export default function shouldUseLatestChain (chain?: string): boolean { - if (isUndefined(chain)) { + if (isUndefined(chain) || chain === null) { return false; }