diff --git a/packages/math/HugeDecimal.ts b/packages/math/HugeDecimal.ts index e4c33d85f2..38dd59f124 100644 --- a/packages/math/HugeDecimal.ts +++ b/packages/math/HugeDecimal.ts @@ -1,7 +1,9 @@ import { BigNumber } from 'bignumber.js' const valueToBigNumber = (n: HugeDecimal.Value): BigNumber => - n instanceof BigNumber + n === null || n === undefined + ? new BigNumber(NaN) + : n instanceof BigNumber ? n : n instanceof HugeDecimal ? n['value']