Skip to content

Commit 4f4421c

Browse files
authored
check for a result before making the description (alexjustesen#238)
1 parent 05ca110 commit 4f4421c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Filament/Widgets/StatsOverview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getCards(): array
1717

1818
return [
1919
Card::make('Latest download', fn (): string => ! blank($result) ? formatBits(formatBytesToBits($result->download)).'ps' : 'n/a')
20-
->description('Tested at: '.optional($result)->created_at->timezone($settings->timezone)->format($settings->time_format))
20+
->description(! blank($result) ? 'Tested at: '.$result->created_at->timezone($settings->timezone)->format($settings->time_format) : 'No tests')
2121
->icon('heroicon-o-download'),
2222
Card::make('Latest upload', fn (): string => ! blank($result) ? formatBits(formatBytesToBits($result->upload)).'ps' : 'n/a')
2323
->icon('heroicon-o-upload'),

0 commit comments

Comments
 (0)