]> source.dussan.org Git - sonarqube.git/commitdiff
Fix error log in webapp
authorsimonbrandhof <simon.brandhof@gmail.com>
Thu, 12 May 2011 09:20:00 +0000 (11:20 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Thu, 12 May 2011 09:20:00 +0000 (11:20 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb

index 83ad7be1879b3d54bd3a62b4ff4b3c05c2dce244..5db6657cebdb132adc970df683652524c9adbbc1 100644 (file)
@@ -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|