]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 Fix issue when no root component on issues search page
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 31 May 2013 13:38:19 +0000 (15:38 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Fri, 31 May 2013 13:38:34 +0000 (15:38 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/issues/_sidebar.html.erb

index b726f192374a55219efb8bd33c06d1f40a05ac5c..53bd96295b497f52d0d93f3253f35778eb979fe2 100644 (file)
@@ -9,7 +9,7 @@
     </li>
     <li id="criteria-project" class="marginbottom5">
       <%= message 'issue_filter.criteria.project' -%>:
-      <% selected_componentRoot = Internal.component_api.findByKey(@filter.criteria('componentRoots')) %>
+      <% selected_componentRoot = Internal.component_api.findByKey(@filter.criteria('componentRoots')) if @filter.criteria('componentRoots') %>
       <%= component_select_tag 'componentRoots', :resource_type_property => 'supportsGlobalDashboards', :width => '100%',
                               :selected_resource => selected_componentRoot,
                               :display_key => true,
     </li>
     <li>
       <%= message 'issue_filter.criteria.assignee' -%>:
-      <% selected_assignee = Api.users.findByLogin(@filter.criteria('assignees')) %>
+      <% selected_assignee = Api.users.findByLogin(@filter.criteria('assignees')) if @filter.criteria('assignees') %>
       <%= user_select_tag('assignees', {:selected_user => selected_assignee, :width => '100%', :placeholder => message('issue_filter.criteria.assignee'),
                         :html_id => 'select-assignee', :open => false, :allow_clear => true}) -%>
     </li>
     <li>
       <%= message 'issue_filter.criteria.reporter' -%>:
-      <% selected_reporter = Api.users.findByLogin(@filter.criteria('reporters')) %>
+      <% selected_reporter = Api.users.findByLogin(@filter.criteria('reporters')) if @filter.criteria('reporters') %>
       <%= user_select_tag('reporters', {:selected_user => selected_reporter, :width => '100%', :placeholder => message('issue_filter.criteria.reporter'),
                                         :html_id => 'select-reporter', :open => false, :allow_clear => true}) -%>
     </li>