Fix missing NetconfNotificationCollector service
[netconf.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / netconf / impl / osgi / NetconfImplActivator.java
index e62089601b0ffc15026c3d17facb3a8ebafbb1f2..7512f2616b4eac6c44a905d2ea9b10c3a9703071 100644 (file)
@@ -72,7 +72,7 @@ public class NetconfImplActivator implements BundleActivator {
                     new ServiceTracker<>(context, NetconfNotificationCollector.class, new ServiceTrackerCustomizer<NetconfNotificationCollector, NetconfNotificationCollector>() {
                         @Override
                         public NetconfNotificationCollector addingService(ServiceReference<NetconfNotificationCollector> reference) {
-                            Preconditions.checkState(listenerReg != null, "Notification collector service was already added");
+                            Preconditions.checkState(listenerReg == null, "Notification collector service was already added");
                             listenerReg = context.getService(reference).registerBaseNotificationPublisher();
                             monitoringService.setNotificationPublisher(listenerReg);
                             return null;