Fix Down/Up time error if device is unpolled (#15545)

This commit is contained in:
Tony Murray
2023-11-04 12:09:26 -05:00
committed by GitHub
parent e1660d9bbe
commit 4be98c7fe2

View File

@@ -301,7 +301,7 @@ class Device extends BaseModel
public function formatDownUptime($short = false): string
{
$time = ($this->status == 1) ? $this->uptime : $this->last_polled->diffInSeconds();
$time = ($this->status == 1) ? $this->uptime : $this->last_polled?->diffInSeconds();
return Time::formatInterval($time, $short);
}