aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb
index 83ad7be1879..5db6657cebd 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb
@@ -24,11 +24,15 @@ class Plugins::ResourceController < ApplicationController
def index
@project = ::Project.by_key(params[:id])
+ return redirect_to home_url if @project.nil?
+
@snapshot=@project.last_snapshot
page_id=params[:page]
@page_proxy=java_facade.getPage(page_id)
+ return redirect_to home_url if @page_proxy.nil?
+
authorized=@page_proxy.getUserRoles().size==0
unless authorized
@page_proxy.getUserRoles().each do |role|