From 93f3e3a500d9ec6a46e498e56e2df5113b1d2c2c Mon Sep 17 00:00:00 2001 From: rsercano Date: Wed, 21 Oct 2020 14:58:45 +0300 Subject: [PATCH] fix: openchannel assertion error for string amount (#1643) --- lib/cli/commands/openchannel.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cli/commands/openchannel.ts b/lib/cli/commands/openchannel.ts index 2f37652ee..d51f52dfe 100644 --- a/lib/cli/commands/openchannel.ts +++ b/lib/cli/commands/openchannel.ts @@ -37,6 +37,10 @@ export const builder = (argv: Argv) => argv .example('$0 openchannel ETH 0.5', 'deposit 0.5 into an ETH Connext channel without specifying a remote node'); export const handler = async (argv: Arguments) => { + if (isNaN(argv.amount)) { + throw 'amount must be a number'; + } + const request = new OpenChannelRequest(); if (argv.node_identifier) { request.setNodeIdentifier(argv.node_identifier);