diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-04-02 17:48:04 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-04-02 17:49:02 +0200 |
commit | 92cc81884284a49758f8778d1a8b812352c9ed18 (patch) | |
tree | e9c0c16696136bb0a60e8bfc3895b3f6e648b778 /sonar-server | |
parent | ae82c4624b4beea7efe47810351e8955e4631c9b (diff) | |
download | sonarqube-92cc81884284a49758f8778d1a8b812352c9ed18.tar.gz sonarqube-92cc81884284a49758f8778d1a8b812352c9ed18.zip |
SONAR-3361 Error : undefined method `source' for nil:NilClass
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb | 34 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/resource/resource_deleted.html.erb | 1 |
2 files changed, 22 insertions, 13 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb index 631ca73e1a2..6ae87b82df2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb @@ -38,22 +38,26 @@ class ResourceController < ApplicationController params[:layout]='false' @snapshot=@resource.last_snapshot - load_extensions() - - if @extension - if @extension.getId()=='violations' - render_violations() - elsif (@extension.getId()=='coverage') - render_coverage() - elsif (@extension.getId()=='source') - render_source() - elsif (@extension.getId()=='duplications') - render_duplications() + if @snapshot + load_extensions() + + if @extension + if @extension.getId()=='violations' + render_violations() + elsif (@extension.getId()=='coverage') + render_coverage() + elsif (@extension.getId()=='source') + render_source() + elsif (@extension.getId()=='duplications') + render_duplications() + else + render_extension() + end else - render_extension() + render_nothing() end else - render_nothing() + render_resource_deleted() end end @@ -537,4 +541,8 @@ class ResourceController < ApplicationController def render_nothing() render :action => 'nothing', :layout => !request.xhr? end + + def render_resource_deleted() + render :action => 'resource_deleted', :layout => !request.xhr? + end end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/resource_deleted.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/resource_deleted.html.erb new file mode 100644 index 00000000000..f137fec47b5 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/resource_deleted.html.erb @@ -0,0 +1 @@ +<%= message('resource_viewer.resource_deleted') -%>
\ No newline at end of file |