Skip to content
Snippets Groups Projects
Verified Commit a8458e79 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

check for nullptr in configuration.cpp

parent daf7ce59
No related branches found
No related tags found
2 merge requests!42Release 0.2.0,!39F remove boost rdep
...@@ -468,7 +468,7 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT ...@@ -468,7 +468,7 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT
} }
// Logging in the configuration leads to additional content. // Logging in the configuration leads to additional content.
if (WRAPPED_JSON_CONFIGURATION(this)->is_object() && if (!this->json_configuration.IsNull() && WRAPPED_JSON_CONFIGURATION(this)->is_object() &&
WRAPPED_JSON_CONFIGURATION(this)->as_object().contains("logging")) { WRAPPED_JSON_CONFIGURATION(this)->as_object().contains("logging")) {
LoggingConfiguration logging_configuration = LoggingConfiguration logging_configuration =
CreateLoggingConfiguration(WRAPPED_JSON_CONFIGURATION(this)->at("logging").as_object()); CreateLoggingConfiguration(WRAPPED_JSON_CONFIGURATION(this)->at("logging").as_object());
...@@ -479,7 +479,7 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT ...@@ -479,7 +479,7 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT
"We are using the default configuration"; "We are using the default configuration";
} }
if (configuration_file_path != nullptr && WRAPPED_JSON_CONFIGURATION(this)->is_object()) { if (configuration_file_path != nullptr && !this->json_configuration.IsNull() && WRAPPED_JSON_CONFIGURATION(this)->is_object() {
CAOSDB_LOG_INFO(logger_name) << "Loaded configuration from " << *(configuration_file_path) CAOSDB_LOG_INFO(logger_name) << "Loaded configuration from " << *(configuration_file_path)
<< "."; << ".";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment