DATAREDIS-972 - Fix validation for RedisCommand argument count.

Original pull request: #448.
This commit is contained in:
Oscar Cai
2019-04-17 16:29:37 +02:00
committed by Mark Paluch
parent 647cf25d2b
commit 051b1ee820
2 changed files with 9 additions and 6 deletions

View File

@@ -347,7 +347,7 @@ public enum RedisCommand {
String.format("%s command requires at least %s arguments.", this.name(), this.minArgs));
}
if (maxArgs != 0 && nrArguments > maxArgs) {
if (maxArgs > 0 && nrArguments > maxArgs) {
throw new IllegalArgumentException(
String.format("%s command requires at most %s arguments.", this.name(), this.maxArgs));
}