From: Ed Warnicke Date: Tue, 12 Aug 2014 15:45:34 +0000 (-0500) Subject: Fix for possible NPE if Bundle is stopped. X-Git-Tag: release/helium~224^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=de2a9ebcf8bdcc8424980878c6c4feda55376f66;ds=sidebyside Fix for possible NPE if Bundle is stopped. Change-Id: Iaf1d44f8b600e69392452b74042812b35e8101de Signed-off-by: Ed Warnicke --- diff --git a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java index 0a48e6c67d..8e9f9978c4 100644 --- a/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java +++ b/opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java @@ -173,8 +173,12 @@ public class ConfigPersisterActivator implements BundleActivator { if(configs != null && !configs.isEmpty()) { configPusher.pushConfigs(configs); } - registration = context.registerService(ConfigPusher.class.getName(), configPusher, null); - configPusher.process(autoCloseables, platformMBeanServer, persisterAggregator); + if(context != null) { + registration = context.registerService(ConfigPusher.class.getName(), configPusher, null); + configPusher.process(autoCloseables, platformMBeanServer, persisterAggregator); + } else { + logger.warn("Unable to process configs as BundleContext is null"); + } } catch (InterruptedException e) { logger.info("ConfigPusher thread stopped",e); }