aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-30 10:39:54 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-30 10:40:57 +0200
commit3176e6a63f06386a78ea73d69c5f082959562ac3 (patch)
treeca3f84a3bb67d36bbb0efced95f1e2930f95e4ac /server
parent6c6dbc10e0e8f7685c3b509acd1c93b8fe84e92b (diff)
downloadsonarqube-3176e6a63f06386a78ea73d69c5f082959562ac3.tar.gz
sonarqube-3176e6a63f06386a78ea73d69c5f082959562ac3.zip
Fix quality flaws
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
index 3cc0cbe5a7f..13860cdbaba 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java
@@ -291,8 +291,9 @@ public class SearchAction implements IssuesWsAction {
}
private void writeResponse(Request request, SearchResult<IssueDoc> result, JsonWriter json) {
- if (result.getFacets().contains(IssueIndex.DEBT_AGGREGATION_NAME)) {
- json.prop("debtTotal", result.getFacets().get(IssueIndex.DEBT_AGGREGATION_NAME).get(Facets.TOTAL));
+ Map<String, Long> debtFacet = result.getFacets().get(IssueIndex.DEBT_AGGREGATION_NAME);
+ if (debtFacet != null) {
+ json.prop("debtTotal", debtFacet.get(Facets.TOTAL));
}
List<String> issueKeys = newArrayList();