From 8568f7a0fb870a5cc532161d6717305c255e03c6 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 21 Oct 2020 18:02:01 +0800 Subject: [PATCH] Avoid settings being reset via WebAPI Closes #13585. --- src/webui/api/appcontroller.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 5967d26d9..a750337c7 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -570,8 +570,10 @@ void AppController::setPreferencesAction() if (hasKey("max_ratio_act")) session->setMaxRatioAction(static_cast(it.value().toInt())); // Add trackers - session->setAddTrackersEnabled(m["add_trackers_enabled"].toBool()); - session->setAdditionalTrackers(m["add_trackers"].toString()); + if (hasKey("add_trackers_enabled")) + session->setAddTrackersEnabled(it.value().toBool()); + if (hasKey("add_trackers")) + session->setAdditionalTrackers(it.value().toString()); // Web UI // Language