From: Fabrice Bellingard Date: Thu, 8 Mar 2012 15:04:09 +0000 (+0100) Subject: SONAR-3277 NPE on duplications tab when a project has been deleted X-Git-Tag: 3.0~231 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7edc07604a25446f4b75726ae8fd72bc4277b160;p=sonarqube.git SONAR-3277 NPE on duplications tab when a project has been deleted --- 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