diff --git a/src/Models/Monitor.php b/src/Models/Monitor.php index 127358c0..0be06bf4 100644 --- a/src/Models/Monitor.php +++ b/src/Models/Monitor.php @@ -112,7 +112,11 @@ public function getRemainingSecondsAttribute(): ?float return null; } - $secondsRunning = now()->getTimestamp() - $this->created_at->getTimestamp(); + if (!$this->started_at) { + return null; + } + + $secondsRunning = now()->getTimestamp() - $this->started_at->getTimestamp(); return (float) ($secondsRunning - ($secondsRunning * $this->progress / 100)); }