]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6331 fix project overview redirection
authorStas Vilchik <vilchiks@gmail.com>
Mon, 9 Nov 2015 13:53:23 +0000 (14:53 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 9 Nov 2015 13:53:23 +0000 (14:53 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb

index fbe46141759a680b95f2b8fea5d7d17c3b1f8eb5..87f15af4a01a32287a45700521fe68838b608080 100644 (file)
@@ -25,13 +25,22 @@ class DashboardController < ApplicationController
   before_filter :login_required, :except => [:index]
 
   def index
-    if params[:id] && !params[:did] && !params[:name]
-      return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
-    end
-
     load_resource()
       if !@resource || @resource.display_dashboard?
-        redirect_if_bad_component()
+        if params[:id]
+          unless @resource
+            return project_not_found
+          end
+          unless @snapshot
+            return project_not_analyzed
+          end
+        end
+
+        # redirect to the project overview
+        if params[:id] && !params[:did] && !params[:name]
+          return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
+        end
+
         load_dashboard()
         load_authorized_widget_definitions()
       else