Skip to content

Commit 178d48b

Browse files
Error handling for undefined arguments in contract.js
1 parent 0dcba88 commit 178d48b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/contract.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ var checkParams = function(args, contract){
6868
}catch(e){
6969
console.log(e, args)
7070
}
71-
if (!args[i]) {
72-
fulfilled = true;
73-
} else {
71+
if (args[i]) {
7472
type = typeOf(args[i]);
7573
fulfilled = false;
7674
for(j=0; j<types.length; j++){
@@ -79,9 +77,9 @@ var checkParams = function(args, contract){
7977
break;
8078
}
8179
}
82-
if(fulfilled===false){
83-
return false;
84-
}
80+
}
81+
if(fulfilled===false){
82+
return false;
8583
}
8684
}
8785
return true;

0 commit comments

Comments
 (0)