Thomas Vachuska

GossipApplicationStore fix to prevent attempt to notify delegate when there isn'…

…t one yet. Fixes an intermittent NPE.

Change-Id: I49a2f0da08949fb4f589e6e831a74e5728196a2f
...@@ -271,6 +271,13 @@ public class GossipApplicationStore extends ApplicationArchive ...@@ -271,6 +271,13 @@ public class GossipApplicationStore extends ApplicationArchive
271 implements EventuallyConsistentMapListener<Application, InternalState> { 271 implements EventuallyConsistentMapListener<Application, InternalState> {
272 @Override 272 @Override
273 public void event(EventuallyConsistentMapEvent<Application, InternalState> event) { 273 public void event(EventuallyConsistentMapEvent<Application, InternalState> event) {
274 + // If we do not have a delegate, refuse to process any events entirely.
275 + // This is to allow the anti-entropy to kick in and process the events
276 + // perhaps a bit later, but with opportunity to notify delegate.
277 + if (delegate == null) {
278 + return;
279 + }
280 +
274 Application app = event.key(); 281 Application app = event.key();
275 InternalState state = event.value(); 282 InternalState state = event.value();
276 283
......