diff --git a/entity/Organisation_entity/recordcontainers/index/affectedIds.js b/entity/Organisation_entity/recordcontainers/index/affectedIds.js
index 12de7b2aec6cc9bd8a679cc865ee7c3c1c1bca9b..a8b02566f9728cbe5a6c53033c884d780b6a71b8 100644
--- a/entity/Organisation_entity/recordcontainers/index/affectedIds.js
+++ b/entity/Organisation_entity/recordcontainers/index/affectedIds.js
@@ -41,8 +41,10 @@ switch (tableName)
                     .arrayColumn();
         });
         break;
+    default:
+        res = [];   //needed, because the Index is being rebuilt if nothing gets returned
 }
 
-if (res) {
     result.object(res);
-}
+    
+
diff --git a/entity/Person_entity/recordcontainers/index/affectedIds.js b/entity/Person_entity/recordcontainers/index/affectedIds.js
index 24ea484ba1ecc993a37d14329c3901e7fb28a1c6..1cbcfeeb6850a41a4d13165adc198e5e10eb94c8 100644
--- a/entity/Person_entity/recordcontainers/index/affectedIds.js
+++ b/entity/Person_entity/recordcontainers/index/affectedIds.js
@@ -47,9 +47,9 @@ switch (tableName)
                     .arrayColumn();
         });
         break;
+    default:
+        res = [];   //needed, because the Index is being rebuilt if nothing gets returned
+        break;
 }
 
-if (res) {
-    result.object(res);
-}
-    
\ No newline at end of file
+    result.object(res);
\ No newline at end of file
diff --git a/process/IndexSearch_lib/process.js b/process/IndexSearch_lib/process.js
index b39ce87ed0696119457a4d37b819455fd182f89b..532ec972fe333d7fb1e89cf731d3127c8bd20a1b 100644
--- a/process/IndexSearch_lib/process.js
+++ b/process/IndexSearch_lib/process.js
@@ -22,15 +22,18 @@ function IndexsearchUtils() {}
  */
 IndexsearchUtils.getAffectedIdValues = function(fieldname, affectedInfoContainer, updateFn) {
     var affectedIds;
-    switch (affectedInfoContainer.action){
-        case "I":  
-            affectedIds = [affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]];
+    switch (affectedInfoContainer.action)
+    {
+        case "I":
+            affectedIds = affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)];
+            affectedIds = affectedIds ? [affectedIds] : []
             break;
         case "U":
             affectedIds = updateFn.call(null, affectedInfoContainer.id);
             break;
         case "D":
-            affectedIds = [affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]];
+            affectedIds = affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)];
+            affectedIds = affectedIds ? [affectedIds] : []
             break;
     }
     return affectedIds || [];