Permalink
Browse files

Don't validate non-required args if not passed

  • Loading branch information...
1 parent cf3f040 commit 65b82d3db6fb245051c88f54288da78384bfe2b6 Steven Haryanto (on PC) committed Mar 2, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Dist/Zilla/Plugin/Rinci/Validate.pm
@@ -187,8 +187,10 @@ sub munge_file {
}
push @code, 'my $arg_err; ' unless keys %vargs;
$vargs{$arg} = 1;
+ push @code, "if (exists($kvar)) { " if !$as->{req};
push @code, __squish_code($cd->{result}), "; ";
push @code, $gen_verr->('$arg_err', $arg);
+ push @code, "}" if !$as->{req};
}
}
join "", @code;

0 comments on commit 65b82d3

Please sign in to comment.