From fa9e4be3531a62c72cd9aba7088133a4b388de4a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 18 Apr 2026 13:52:43 +0200 Subject: [PATCH] Catch missing variable. --- app/Http/Controllers/PreferencesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 69076619f5..f8eb3e703d 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -270,10 +270,10 @@ final class PreferencesController extends Controller $variables = ['slack_webhook_url', 'pushover_app_token', 'pushover_user_token', 'ntfy_server', 'ntfy_topic', 'ntfy_user', 'ntfy_pass']; $all = $request->only($variables); foreach ($variables as $variable) { - if ('' === $all[$variable]) { + if (!array_key_exists($variable, $all) || '' === $all[$variable]) { Preferences::delete($variable); } - if ('' !== $all[$variable]) { + if (array_key_exists($variable, $all) && '' !== $all[$variable]) { Preferences::setEncrypted($variable, $all[$variable]); } }