diff --git a/bin/scheduler.php b/bin/scheduler.php
index 1eef5ce4725dd2e0b7eb864eaab8889f215cf71a..f057e537e922d12056288d4521b79954c1d5806c 100644
--- a/bin/scheduler.php
+++ b/bin/scheduler.php
@@ -82,8 +82,8 @@ foreach ($schedules as $schedule) {
         continue;
     }
 
-    $lastExecution = new DateTime($schedule['last_execution']);
     if (!empty($schedule['last_execution'])) {
+        $lastExecution = new DateTime($schedule['last_execution']);
         $difference = $currentDate->diff($lastExecution);
         if (empty($schedule['frequency']) && $lastExecution->format('Y-m-d') == $currentDate->format('Y-m-d')) {
             continue;