diff --git a/include/management/snapshot/class_SnapshotCreateDialog.inc b/include/management/snapshot/class_SnapshotCreateDialog.inc
index b8f7d50b84bb22d369cc3bc2e8a65736f8a50ff4..7860e00e624835106b468d1b42ffa858ab6aff2d 100644
--- a/include/management/snapshot/class_SnapshotCreateDialog.inc
+++ b/include/management/snapshot/class_SnapshotCreateDialog.inc
@@ -91,7 +91,11 @@ class SnapshotCreateDialog extends ManagementDialog
   public function getLdapRecordedDataSources () : array
   {
     global $config;
-    $recordedDataSources = $config->current['SNAPSHOTSOURCEDATA'];
+
+    $recordedDataSources = [];
+    if (isset($config->current['SNAPSHOTSOURCEDATA']) && !empty($config->current['SNAPSHOTSOURCEDATA'])) {
+      $recordedDataSources = $config->current['SNAPSHOTSOURCEDATA'];
+    }
 
     return $recordedDataSources;
   }
diff --git a/include/management/snapshot/class_SnapshotHandler.inc b/include/management/snapshot/class_SnapshotHandler.inc
index 130552e4a4df95117e4ec78a5125336b6b965bd4..364932e081849e808af55354425aab210c05d148 100644
--- a/include/management/snapshot/class_SnapshotHandler.inc
+++ b/include/management/snapshot/class_SnapshotHandler.inc
@@ -290,37 +290,50 @@ class SnapshotHandler
   {
     global $config;
 
-    $snapMinRetention  = $config->current['SNAPSHOTMINRETENTION'];
-    $snapRetentionDays = $config->current['SNAPSHOTRETENTIONDAYS'];
+    // In case the snap configuration has not set any numbers
+    if (isset($config->current['SNAPSHOTMINRETENTION']) && !empty($config->current['SNAPSHOTMINRETENTION'])) {
+      $snapMinRetention  = $config->current['SNAPSHOTMINRETENTION'];
+    } else {
+      $snapMinRetention  = 0;
+    }
+
+    if (isset($config->current['SNAPSHOTRETENTIONDAYS']) && !empty($config->current['SNAPSHOTRETENTIONDAYS'])) {
+      $snapRetentionDays = $config->current['SNAPSHOTRETENTIONDAYS'];
+    } else {
+      $snapRetentionDays = -1;
+    }
 
     // calculate the epoch date on which snaps can be delete.
-    $todayMinusRetention = time() - ($snapRetentionDays * 24 * 60 * 60);
-    $snapDateToDelete = strtotime(date('Y-m-d H:i:s', $todayMinusRetention));
-
-    $dnSnapshotsList = $this->getSnapshots($dn, TRUE);
-    $snapToDelete = [];
-    $snapCount = 0;
-
-    if (isset($dnSnapshotsList) && !empty($dnSnapshotsList)) {
-      foreach ($dnSnapshotsList as $snap) {
-        $snapCount += 1;
-        // let's keep seconds instead of nanosecs
-        $snapEpoch = preg_split('/-/', $snap['gosaSnapshotTimestamp'][0]);
-        if ($snapEpoch[0] < $snapDateToDelete) {
-          $snapToDelete[] = $snap['dn'];
+    if ($snapRetentionDays !== 1) {
+      $todayMinusRetention = time() - ($snapRetentionDays * 24 * 60 * 60);
+      $snapDateToDelete = strtotime(date('Y-m-d H:i:s', $todayMinusRetention));
+
+      $dnSnapshotsList = $this->getSnapshots($dn, TRUE);
+      $snapToDelete = [];
+      $snapCount = 0;
+
+      // Generate an arrays with snapshot to delete due to overdate.
+      if (isset($dnSnapshotsList) && !empty($dnSnapshotsList)) {
+        foreach ($dnSnapshotsList as $snap) {
+          $snapCount += 1;
+          // let's keep seconds instead of nanosecs
+          $snapEpoch = preg_split('/-/', $snap['gosaSnapshotTimestamp'][0]);
+          if ($snapEpoch[0] < $snapDateToDelete) {
+            $snapToDelete[] = $snap['dn'];
+          }
         }
       }
-    }
 
-    // The not empty is not mandatory but is more ressource friendly
-    if (!empty($snapToDelete) && ($snapCount > $snapMinRetention)) {
-      $snapToKeep = $snapCount - $snapMinRetention;
-      // Sort snapToDelete by old first DN timestamp is the only thing different.
-      sort($snapToDelete);
-      for ($i = 0; $i < $snapToKeep; $i++) {
-        // not empty required because array keeps on being iterated even if NULL object.
-        if (!empty($snapToDelete[$i])) {
-          $this->removeSnapshot($snapToDelete[$i]);
+      // The not empty is not mandatory but is more ressource friendly
+      if (!empty($snapToDelete) && ($snapCount > $snapMinRetention)) {
+        $snapToKeep = $snapCount - $snapMinRetention;
+        // Sort snapToDelete by old first DN timestamp is the only thing different.
+        sort($snapToDelete);
+        for ($i = 0; $i < $snapToKeep; $i++) {
+          // not empty required because array keeps on being iterated even if NULL object.
+          if (!empty($snapToDelete[$i])) {
+            $this->removeSnapshot($snapToDelete[$i]);
+          }
         }
       }
     }