Skip to content

Commit

Permalink
Merge pull request #440 from vert-x3/issues/avoid-index-out-of-bounds
Browse files Browse the repository at this point in the history
Avoid IOB
  • Loading branch information
pmlopes committed Dec 11, 2020
2 parents aabcf2f + c94d6c1 commit 1a3b9c4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ private NV(String name, String... pairs) {
if (pairs == null || pairs.length == 0) {
this.values = Collections.emptyMap();
} else {
if (pairs.length % 2 != 0) {
throw new IllegalArgumentException("pairs must have even length");
}
Map<String, String> tmp = new HashMap<>();
for (int i = 0; i < pairs.length; i += 2) {
tmp.put(pairs[i], pairs[i + 1]);
Expand Down

0 comments on commit 1a3b9c4

Please sign in to comment.