diff options
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb index 01545026f4b..8b4e7107476 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb @@ -31,14 +31,12 @@ } <% - if @resource - # we keep only root resources in the "Recent Projects" - root_resource = @resource.root_project + if @resource && Project.root_qualifiers.include?(@resource.qualifier) %> else { - sonarRecentHistory.add('<%= root_resource.key -%>', - '<%= root_resource.name -%>', - '<%= Api::Utils.java_facade.getResourceType(root_resource.qualifier).getIconPath() -%>'); + sonarRecentHistory.add('<%= @resource.key -%>', + '<%= @resource.name -%>', + '<%= Api::Utils.java_facade.getResourceType(@resource.qualifier).getIconPath() -%>'); } <% end %> |