diff options
Diffstat (limited to 'src/ui/struct/SettingsObject.cpp')
-rw-r--r-- | src/ui/struct/SettingsObject.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/struct/SettingsObject.cpp b/src/ui/struct/SettingsObject.cpp index 72ee279e..31e71e46 100644 --- a/src/ui/struct/SettingsObject.cpp +++ b/src/ui/struct/SettingsObject.cpp @@ -30,9 +30,14 @@ nlohmann::json& GpgFrontend::UI::SettingsObject::Check( const std::string& key, nlohmann::json default_value) { - if (!nlohmann::json::contains(key)) - nlohmann::json::operator[](key) = std::move(default_value); - return nlohmann::json::operator[](key); + try { + if (!this->nlohmann::json::contains(key)) + this->nlohmann::json::operator[](key) = std::move(default_value); + return this->nlohmann::json::operator[](key); + } catch (const std::exception& e) { + LOG(ERROR) << e.what(); + throw e; + } } GpgFrontend::UI::SettingsObject GpgFrontend::UI::SettingsObject::Check( |