Refactor persister: require only capabilities referenced by the xml snapshot.
[controller.git] / opendaylight / config / logback-config / src / main / java / org / opendaylight / controller / config / yang / logback / config / LogbackModule.java
index 9cbcd47b20dbe48cc6cfacdade3d50a8c3ed474e..d75bf6367a6d393d7ee2773a5d903733ae2b21aa 100644 (file)
@@ -54,11 +54,12 @@ public final class LogbackModule extends org.opendaylight.controller.config.yang
                     "LoggerName needs to be set", loggersJmxAttribute);
             JmxAttributeValidationException.checkCondition(!loggerToValidate.getLevel().isEmpty(),
                     "Level needs to be set", loggersJmxAttribute);
-
-            for (String appenderName : loggerToValidate.getAppenders()) {
-                JmxAttributeValidationException.checkCondition(appenderNames.contains(appenderName), "Appender "
-                        + appenderName + " referenced by logger " + loggerToValidate.getLoggerName()
-                        + " not present in configuration, present appenders: " + appenderNames, loggersJmxAttribute);
+            if (loggerToValidate.getAppenders() != null) {
+                for (String appenderName : loggerToValidate.getAppenders()) {
+                    JmxAttributeValidationException.checkCondition(appenderNames.contains(appenderName), "Appender "
+                            + appenderName + " referenced by logger " + loggerToValidate.getLoggerName()
+                            + " not present in configuration, present appenders: " + appenderNames, loggersJmxAttribute);
+                }
             }
 
         }