From 7edc07604a25446f4b75726ae8fd72bc4277b160 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 8 Mar 2012 16:04:09 +0100 Subject: [PATCH] SONAR-3277 NPE on duplications tab when a project has been deleted --- .../webapp/WEB-INF/app/controllers/resource_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 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 a2c95f67883..710b796937a 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 @@ -292,9 +292,9 @@ class ResourceController < ApplicationController resource = Project.by_key(resource_key) resource_by_key[resource_key] = resource end - dup_group << {:resource => resource, :lines_count => block.attributes['l'], :from_line => block.attributes['s']} + dup_group << {:resource => resource, :lines_count => block.attributes['l'], :from_line => block.attributes['s']} if resource end - duplication_groups << dup_group + duplication_groups << dup_group if dup_group.size > 1 end end -- 2.39.5