From ce1b5defd0307bd98aa475a288584bef6e424926 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 19 Jun 2014 18:07:24 +0200 Subject: [PATCH] SONAR-5007 Fix display when no active rules --- .../src/main/webapp/WEB-INF/app/helpers/profiles_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/profiles_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/profiles_helper.rb index 280eaf1331d..ccb40eecbb2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/profiles_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/profiles_helper.rb @@ -24,7 +24,7 @@ module ProfilesHelper end def label_for_rules_count(qProfile, all_profile_stats) - profile_stat = all_profile_stats[qProfile.key()] + profile_stat = all_profile_stats[qProfile.key()] if all_profile_stats profile_rules_count = profile_rules_count(qProfile, profile_stat) label = "#{profile_rules_count} #{message('rules').downcase}" @@ -64,6 +64,6 @@ module ProfilesHelper def overriding_rules_count(profile_stat) inheritance_stats = Hash[ *profile_stat.get('inheritance').collect { |v| [ v.getKey(), v ] }.flatten ] if profile_stat - inheritance_stats['OVERRIDES'].getValue().to_i if inheritance_stats['OVERRIDES'] + inheritance_stats['OVERRIDES'].getValue().to_i if inheritance_stats && inheritance_stats['OVERRIDES'] end end -- 2.39.5