aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
index 008f76db170..b6a5ba9f4e2 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
@@ -40,11 +40,16 @@ class ProfilesController < ApplicationController
require_parameters 'key'
call_backend do
@profile = Internal.qprofile_loader.getByKey(params[:key])
- not_found('Profile not found') unless @profile
- @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
- @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ if @profile
+ @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
+ @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ set_profile_breadcrumbs
+ else
+ # SONAR-5630
+ flash[:error] = message('quality_profiles.deleted_profile', :params => params[:key])
+ redirect_to :controller => 'profiles', :action => 'index'
+ end
end
- set_profile_breadcrumbs
end
# GET /profiles/create_form?language=<language>