munendrasn commented on a change in pull request #978: SOLR-13207: Handle misuse of < operator URL: https://github.com/apache/lucene-solr/pull/978#discussion_r339955457
########## File path: solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java ########## @@ -678,7 +678,17 @@ static int calculateMinShouldMatch(int optionalClauseCount, String spec) { spec = spaceAroundLessThanPattern.matcher(spec).replaceAll("<"); for (String s : spacePattern.split(spec)) { String[] parts = lessThanPattern.split(s,0); - int upperBound = Integer.parseInt(parts[0]); + if (parts.length == 0) { + throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, + "Operator < must be followed by a number"); + } + int upperBound; + try { + upperBound = Integer.parseInt(parts[0]); Review comment: could you please handle [this](https://github.com/apache/lucene-solr/pull/978/files#diff-72f9d854f80b7cfab1f2da1c7bdcb607R707) too? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org