]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2646 When there isn't any violation in a project the hotspot widget 'Most viola...
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 15 Aug 2011 14:35:03 +0000 (16:35 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 15 Aug 2011 14:35:03 +0000 (16:35 +0200)
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java

index 44d08372033f13ac3b2cd1c1f68f778663b30ba0..4c707e6f32773f8bd306623cac8a634022418637 100644 (file)
@@ -91,7 +91,7 @@ public class MostViolatedRules extends AbstractHotspot {
 
       @Override
       protected void doOnResponse(Resource resource) {
-        if (resource.getMeasures().isEmpty()) {
+        if (resource==null || resource.getMeasures().isEmpty()) {
           renderEmptyResults();
         } else {
           renderGrid(resource);
@@ -133,9 +133,9 @@ public class MostViolatedRules extends AbstractHotspot {
         .setDepth(0)
         .setExcludeRules(false)
         .setLimit(LIMIT);
-    String priority = getSelectedPriority();
-    if (priority!=null) {
-      query.setRulePriorities(priority);
+    String severity = getSelectedPriority();
+    if (severity!=null) {
+      query.setRuleSeverities(severity);
     }
     return query;
   }