diff options
author | Saturneric <[email protected]> | 2022-02-07 11:55:13 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-02-07 11:55:13 +0000 |
commit | e6f6731ad82fc4b7dda4267840df074f992f7442 (patch) | |
tree | 8454c04ac170c754e27b3bfb5d7c2ef2bd39c41b /src/ui/struct/SettingsObject.cpp | |
parent | <fix>(ui): Fix type exception in SMTP settings (diff) | |
download | GpgFrontend-e6f6731ad82fc4b7dda4267840df074f992f7442.tar.gz GpgFrontend-e6f6731ad82fc4b7dda4267840df074f992f7442.zip |
<fix>(core, ui): Fix the remaining problems in the data object
Diffstat (limited to 'src/ui/struct/SettingsObject.cpp')
-rw-r--r-- | src/ui/struct/SettingsObject.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ui/struct/SettingsObject.cpp b/src/ui/struct/SettingsObject.cpp index 5405611e..63df0900 100644 --- a/src/ui/struct/SettingsObject.cpp +++ b/src/ui/struct/SettingsObject.cpp @@ -36,12 +36,11 @@ nlohmann::json& GpgFrontend::UI::SettingsObject::Check( this->nlohmann::json::operator=(nlohmann::json::object()); } - LOG(INFO) << "Checking key: " << key; - try { if (!this->nlohmann::json::contains(key) || this->nlohmann::json::at(key).is_null() || - this->nlohmann::json::at(key).type() != default_value.type()) { + this->nlohmann::json::at(key).type_name() != + default_value.type_name()) { LOG(INFO) << "Added missing key: " << key; if (default_value.is_null()) { LOG(WARNING) << "Default value is null, using empty object"; @@ -65,8 +64,6 @@ GpgFrontend::UI::SettingsObject GpgFrontend::UI::SettingsObject::Check( this->nlohmann::json::operator=(nlohmann::json::object()); } - LOG(INFO) << "Checking key: " << key; - if (!nlohmann::json::contains(key) || this->nlohmann::json::at(key).is_null() || this->nlohmann::json::at(key).type() != nlohmann::json::value_t::object) { |