]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3277 NPE on duplications tab when a project has been deleted
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 8 Mar 2012 15:04:09 +0000 (16:04 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 8 Mar 2012 15:04:09 +0000 (16:04 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb

index a2c95f6788388fa15f2cf9ee2e9f4f18c66be235..710b796937add97c9e3c57e410d3229e6d3ab20b 100644 (file)
@@ -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