Eliminate dead letters message when there's no sender
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DataChangeListenerRegistrationActor.java
index 2632498..29e4a1a 100644 (file)
@@ -45,7 +45,11 @@ public class DataChangeListenerRegistrationActor extends AbstractUntypedActor {
 
     private void closeListenerRegistration() {
         registration.close();
-        getSender().tell(CloseDataChangeListenerRegistrationReply.INSTANCE, getSelf());
+
+        if(isValidSender(getSender())) {
+            getSender().tell(CloseDataChangeListenerRegistrationReply.INSTANCE, getSelf());
+        }
+
         getSelf().tell(PoisonPill.getInstance(), getSelf());
     }