From d36f4e5cd9675f4e16ab7d65fe43fe69153135ec Mon Sep 17 00:00:00 2001 From: MistEO Date: Wed, 18 May 2022 03:10:28 +0800 Subject: [PATCH] =?UTF-8?q?fix.=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BF=A1=E7=94=A8=E5=95=86=E5=BA=97=E9=94=99=E8=AF=AF=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/516 --- src/MeoAssistant/MallTask.cpp | 5 ++++- src/MeoAsstGui/ViewModels/SettingsViewModel.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MeoAssistant/MallTask.cpp b/src/MeoAssistant/MallTask.cpp index 19c9614d2d..54fdd8cd8b 100644 --- a/src/MeoAssistant/MallTask.cpp +++ b/src/MeoAssistant/MallTask.cpp @@ -26,7 +26,10 @@ bool asst::MallTask::set_params(const json::value& params) if (params.contains("buy_first") && params.at("buy_first").is_array()) { std::vector buy_first; for (auto& name : params.at("buy_first").as_array()) { - buy_first.emplace_back(name.as_string()); + std::string name_str = name.as_string(); + if (!name_str.empty()) { + buy_first.emplace_back(name_str); + } } if (!buy_first.empty()) { m_shopping_first_task_ptr->set_white_list(std::move(buy_first)); diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index bf3e49aba5..2bbdacc655 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -345,7 +345,7 @@ namespace MeoAsstGui set { SetAndNotify(ref _creditFirstList, value); - ViewStatusStorage.Set("Mall.CreditFirstList", value.ToString()); + ViewStatusStorage.Set("Mall.CreditFirstList", value); } } @@ -357,7 +357,7 @@ namespace MeoAsstGui set { SetAndNotify(ref _creditBlackList, value); - ViewStatusStorage.Set("Mall.CreditBlackList", value.ToString()); + ViewStatusStorage.Set("Mall.CreditBlackList", value); } }