core: Fix segfault in LoggerFactory::onConfig
refs: #1579
Change-Id: I5054880d9bc9b6185fab8d43fdaee194f7526965
diff --git a/core/logger-factory.cpp b/core/logger-factory.cpp
index 6bea7a6..6805af9 100644
--- a/core/logger-factory.cpp
+++ b/core/logger-factory.cpp
@@ -142,8 +142,7 @@
NFD_LOG_DEBUG("Failed to configure logging level for module \"" <<
item->first << "\" (module not found)");
}
-
- if (!isDryRun)
+ else if (!isDryRun)
{
// std::cerr << "changing level for module " << item->first << " to " << level << std::endl;
loggerIt->second.setLogLevel(level);