]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5012 Protect against facets view unavailability
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Jun 2014 15:21:44 +0000 (17:21 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 11 Jun 2014 15:21:53 +0000 (17:21 +0200)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-facets-view.coffee

index 1d66c2ee5a55301c66f79246603ed092f79f7087..22204f2929abbf815d24ced0aadc41da4d07c161 100644 (file)
@@ -41,8 +41,9 @@ define [
 
     getQuery: ->
       q = {}
-      @ui.facets.each ->
-        property = jQuery(@).data 'property'
-        activeOptions = jQuery(@).find('.active').map(-> jQuery(@).data 'key').get()
-        q[property] = activeOptions.join ',' if activeOptions.length > 0
+      if @ui.facets.each
+        @ui.facets.each ->
+          property = jQuery(@).data 'property'
+          activeOptions = jQuery(@).find('.active').map(-> jQuery(@).data 'key').get()
+          q[property] = activeOptions.join ',' if activeOptions.length > 0
       q