Skip to content

Commit c07137d

Browse files
llingllinggit
authored andcommitted
Throw an exception when constructing a query with empty string as criteria #1290
1 parent 3f45276 commit c07137d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/impl/StringQueryDefinitionImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public String getCriteria() {
3131

3232
@Override
3333
public void setCriteria(String criteria) {
34+
if (criteria.length() == 0) {
35+
throw new IllegalArgumentException("Criteria cannot be an empty string.");
36+
}
3437
this.criteria = criteria;
3538
}
3639

0 commit comments

Comments
 (0)