Permalink
Browse files

fixed NPE in GraphHandler for missing "e" URL parameter

when the "e" URL parameter is not being added to the URL (e.g. for legacy graph URLs), then a NullPointerException occured. This has been fixed.
  • Loading branch information...
1 parent 64f99e5 commit d2048254eb598e1e18b33a5f24f5fc2fd9fdd503 @p-goetz p-goetz committed with bsjaekel Apr 11, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/tsd/GraphHandler.java
@@ -253,14 +253,16 @@ private Plot preparePlot(final TSDB tsdb, final HttpQuery query,
List<DataPoints> result = new ArrayList<DataPoints>();
List<String> arithmeticExpressions = query.getQueryStringParams("e");
- for (String expression : arithmeticExpressions) {
- if (expression != null && !expression.isEmpty()) {
- ArithmeticExpressionCalculator calculator = new ArithmeticExpressionCalculator(
- expression);
+ if (arithmeticExpressions != null) {
+ for (String expression : arithmeticExpressions) {
+ if (expression != null && !expression.isEmpty()) {
+ ArithmeticExpressionCalculator calculator = new ArithmeticExpressionCalculator(
+ expression);
- LOG.info("calculateArithmeticExpressions: " + expression);
+ LOG.info("calculateArithmeticExpressions: " + expression);
- result.add(calculator.calculateArithmeticExpression(queryResults));
+ result.add(calculator.calculateArithmeticExpression(queryResults));
+ }
}
}

0 comments on commit d204825

Please sign in to comment.