From 8ce2b87e87dd72067105fe0f8f558b131b061522 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 14 Aug 2018 14:07:28 +0200 Subject: [PATCH] null/undefined checks for boolean --- packages/type-params/src/decode/value/bool.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/type-params/src/decode/value/bool.ts b/packages/type-params/src/decode/value/bool.ts index f000832368..7a694faec3 100644 --- a/packages/type-params/src/decode/value/bool.ts +++ b/packages/type-params/src/decode/value/bool.ts @@ -4,8 +4,11 @@ import { Param$Decoded } from '../../types'; +import isNull from '@polkadot/util/is/null'; +import isUndefined from '@polkadot/util/is/undefined'; + export default function bool (input: Uint8Array | null | undefined): Param$Decoded { - if (!input) { + if (isUndefined(input) || isNull(input)) { return { length: 0, value: false