diff --git a/app/Models/Device.php b/app/Models/Device.php index acde470d3f..cb8fc794ba 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -279,7 +279,13 @@ class Device extends BaseModel */ public function downSince(): Carbon { - return Carbon::createFromTimestamp((int) $this->getCurrentOutage()?->going_down); + $deviceOutage = $this->getCurrentOutage(); + + if ($deviceOutage) { + return Carbon::createFromTimestamp((int) $deviceOutage->going_down); + } + + return $this->last_polled ?? Carbon::now(); } /**