Skip to content

Commit

Permalink
Test for null, avoid NPE
Browse files Browse the repository at this point in the history
fix #2280
  • Loading branch information
theultimatequestion authored and manolama committed Jul 10, 2023
1 parent fd78f0e commit 9de0f9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tsd/GraphHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,12 @@ private void doGraph(final TSDB tsdb, final HttpQuery query)
}

options = query.getQueryStringParams("o");
for (int i = 0; i < options.size(); i++) {
if (!allow_list.contains(options.get(i))) {
throw new BadRequestException("Query option at index " + i
+ " was not in the allow list.");
if (!(options == null)) {
for (int i = 0; i < options.size(); i++) {
if (!allow_list.contains(options.get(i))) {
throw new BadRequestException("Query option at index " + i
+ " was not in the allow list.");
}
}
}
}
Expand Down

0 comments on commit 9de0f9f

Please sign in to comment.