Skip to content

Commit 7304255

Browse files
authored
Update AvailabilityMapController.php (librenms#18456)
1 parent 26f7108 commit 7304255

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/Http/Controllers/Widgets/AvailabilityMapController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ private function sort(array &$data): void
182182

183183
private function getDeviceLabel(Device $device, string $state_name): string
184184
{
185-
return match ($this->getSettings()['color_only_select']) {
185+
$choice = (int) ($this->getSettings()['color_only_select'] ?? 0);
186+
187+
return match ($choice) {
186188
1 => '',
187189
4 => $device->shortDisplayName(),
188190
2 => strtolower($device->hostname),
@@ -193,7 +195,9 @@ private function getDeviceLabel(Device $device, string $state_name): string
193195

194196
private function getServiceLabel(Service $service): string
195197
{
196-
if ($this->getSettings()['color_only_select'] == 1) {
198+
$choice = (int) ($this->getSettings()['color_only_select'] ?? 0);
199+
200+
if ($choice == 1) {
197201
return '';
198202
}
199203

0 commit comments

Comments
 (0)