Pull up fix for CONNECTORS-807 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/manifoldcf/branches/release-1.4-branch@1541410 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index e7bcf55..d6fee9a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,10 @@
 
 ======================= Release 1.4.1 =====================
 
+CONNECTORS-807: Handle the case when there are no documents being
+deleted.
+(Adian Conlon, Karl Wright)
+
 CONNECTORS-806: Web connector session passwords were not being
 handled in the UI properly.
 (Karl Wright)
diff --git a/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java b/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
index fce65fb..90d5dbe 100644
--- a/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
+++ b/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobQueue.java
@@ -709,7 +709,8 @@
       list.add(identifiers[i].getID());
       i++;
     }
-    doDeletes(list);
+    if (list.size() > 0)
+      doDeletes(list);
     noteModifications(0,0,identifiers.length);
   }