From 58a733daa809f77959f8f6136aa3c9ecf1ea2f3a Mon Sep 17 00:00:00 2001 From: Alex Justesen Date: Tue, 19 Sep 2023 20:03:04 -0400 Subject: [PATCH 1/2] [Bugfix] Capture null speedtest server default to prevent the error (#793) --- app/Filament/Pages/Settings/GeneralPage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Filament/Pages/Settings/GeneralPage.php b/app/Filament/Pages/Settings/GeneralPage.php index 526e021cf..728defa8e 100644 --- a/app/Filament/Pages/Settings/GeneralPage.php +++ b/app/Filament/Pages/Settings/GeneralPage.php @@ -102,6 +102,10 @@ public function form(Form $form): Form protected function getServerLabels(array $values): array { + if (count($values) && is_null($values[0])) { + return []; + } + return collect($values)->mapWithKeys(function (string $item, int $key) { return [$item => $item]; })->toArray(); From f3b51bb45f11096efe4116a127f6e8a226c015f5 Mon Sep 17 00:00:00 2001 From: Alex Justesen Date: Tue, 19 Sep 2023 20:06:36 -0400 Subject: [PATCH 2/2] [Chore] Added ID to manually entered server (#794) --- app/Filament/Pages/Settings/GeneralPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Pages/Settings/GeneralPage.php b/app/Filament/Pages/Settings/GeneralPage.php index 728defa8e..88c81a8e3 100644 --- a/app/Filament/Pages/Settings/GeneralPage.php +++ b/app/Filament/Pages/Settings/GeneralPage.php @@ -133,7 +133,7 @@ protected function getServerSearchOptions(string $search): array return collect([ [ 'id' => $search, - 'name' => 'Unknown server', + 'name' => $search.' (Manually entered server)', ], ])->pluck('name', 'id')->toArray(); }