diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java b/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java index ad7900fa..20663bb7 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java @@ -379,10 +379,7 @@ public final class Utils { * @throws IllegalArgumentException if the character sequence is empty */ public static T notEmpty(T chars, String message, Object... values) { - if (chars == null) { - throw new IllegalArgumentException(String.format(message, values)); - } - if (chars.length() == 0) { + if (chars == null || chars.length() == 0) { throw new IllegalArgumentException(String.format(message, values)); } return chars;