Skip to content

Commit 61f9033

Browse files
fix: ensure formatStateUsing safely handles state objects in ViewMonitoring
1 parent b15250a commit 61f9033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Filament/Organizations/Resources/Cases/Resources/Monitoring/Pages/ViewMonitoring.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ public function infolist(Schema $schema): Schema
126126
->formatStateUsing(fn ($state) => $this->formatDateSafe($state)),
127127
TextEntry::make('aggressor_relationship')
128128
->label(__('monitoring.labels.aggressor_relationship'))
129-
->formatStateUsing(fn ($state) => $state?->getLabel() ?? ''),
129+
->formatStateUsing(fn ($state) => is_object($state) && method_exists($state, 'getLabel') ? $state->getLabel() : ''),
130130
TextEntry::make('maintenance_sources')
131131
->label(__('monitoring.labels.maintenance_sources'))
132-
->formatStateUsing(fn ($state) => $state?->getLabel() ?? ''),
132+
->formatStateUsing(fn ($state) => is_object($state) && method_exists($state, 'getLabel') ? $state->getLabel() : ''),
133133
TextEntry::make('location')
134134
->label(__('monitoring.labels.location')),
135135
TextEntry::make('observations')

0 commit comments

Comments
 (0)