]> source.dussan.org Git - sonarqube.git/commitdiff
fix purge task when trying to delete a non existant component
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 5 Dec 2014 08:49:12 +0000 (09:49 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 5 Dec 2014 08:50:50 +0000 (09:50 +0100)
sonar-core/src/main/java/org/sonar/server/computation/dbcleaner/DefaultPurgeTask.java

index df991fe48a92ff6f3aacfb2dd30be742330f1224..4324aedd7eb7df92cc7aeb75b132d62a16504e20 100644 (file)
@@ -56,8 +56,11 @@ public class DefaultPurgeTask implements PurgeTask {
 
   @Override
   public DefaultPurgeTask delete(long resourceId) {
-    ResourceDto project = resourceDao.getResource(resourceId);
-    purgeDao.deleteResourceTree(new IdUuidPair(project.getId(), project.getUuid()));
+    ResourceDto resource = resourceDao.getResource(resourceId);
+    if (resource != null) {
+      purgeDao.deleteResourceTree(new IdUuidPair(resource.getId(), resource.getUuid()));
+    }
+
     return this;
   }