From c5e190680fa04939c256e17fb32d415b0f479e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Miro=C5=84czuk?= Date: Wed, 31 Mar 2021 18:50:59 +0200 Subject: [PATCH] abstore smart contract - Fixed Aval and Bval validation (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Mirończuk --- chaincode/abstore/javascript/abstore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaincode/abstore/javascript/abstore.js b/chaincode/abstore/javascript/abstore.js index adcfdd9c..0969d98b 100644 --- a/chaincode/abstore/javascript/abstore.js +++ b/chaincode/abstore/javascript/abstore.js @@ -25,7 +25,7 @@ var ABstore = class { let Aval = args[1]; let Bval = args[3]; - if (typeof parseInt(Aval) !== 'number' || typeof parseInt(Bval) !== 'number') { + if (isNaN(parseInt(Aval)) || isNaN(parseInt(Bval))) { return shim.error('Expecting integer value for asset holding'); }