Skip to content

Commit

Permalink
Problem when any of ACL Middleware argument is null or undefined | So…
Browse files Browse the repository at this point in the history
…lved
  • Loading branch information
akashdeepsinghal committed Oct 1, 2016
1 parent 1440d93 commit 0dcba88
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lib/contract.js
Original file line number Diff line number Diff line change
@@ -68,17 +68,20 @@ var checkParams = function(args, contract){
}catch(e){
console.log(e, args)
}

type = typeOf(args[i]);
fulfilled = false;
for(j=0; j<types.length; j++){
if (type === types[j]){
fulfilled = true;
break;
if (!args[i]) {
fulfilled = true;
} else {
type = typeOf(args[i]);
fulfilled = false;
for(j=0; j<types.length; j++){
if (type === types[j]){
fulfilled = true;
break;
}
}
if(fulfilled===false){
return false;
}
}
if(fulfilled===false){
return false;
}
}
return true;

0 comments on commit 0dcba88

Please sign in to comment.