From ffb8b0a619be3b8fb30a6acc99f590a6b40d49e1 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 27 Nov 2018 13:35:39 -0800 Subject: Changed remaining instances of implicit `bool` casts to explicit lodash calls --- packages/utils/src/abi_encoder/evm_data_type_factory.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/utils/src/abi_encoder/evm_data_type_factory.ts') diff --git a/packages/utils/src/abi_encoder/evm_data_type_factory.ts b/packages/utils/src/abi_encoder/evm_data_type_factory.ts index bfe457367..16a0b724d 100644 --- a/packages/utils/src/abi_encoder/evm_data_type_factory.ts +++ b/packages/utils/src/abi_encoder/evm_data_type_factory.ts @@ -2,6 +2,7 @@ /* tslint:disable max-classes-per-file */ /* tslint:disable no-construct */ import { DataItem, MethodAbi } from 'ethereum-types'; +import * as _ from 'lodash'; import { DataType, DataTypeFactory } from './abstract_data_types'; import * as Impl from './evm_data_types'; @@ -105,9 +106,9 @@ export class EvmDataTypeFactory implements DataTypeFactory { dataType = new String(dataItem); } // @TODO: Implement Fixed/UFixed types - if (!dataType) { + if (_.isUndefined(dataType)) { throw new Error(`Unrecognized data type: '${dataItem.type}'`); - } else if (parentDataType && !dataType.isStatic()) { + } else if (!_.isUndefined(parentDataType) && !dataType.isStatic()) { const pointerToDataType = new Pointer(dataType, parentDataType); return pointerToDataType; } -- cgit v1.2.3