Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Null Sender issue #1212

Closed
Aaronontheweb opened this issue Aug 7, 2015 · 0 comments
Closed

Fix Null Sender issue #1212

Aaronontheweb opened this issue Aug 7, 2015 · 0 comments
Assignees
Labels

Comments

@Aaronontheweb
Copy link
Member

Per what we discussed on Gitter:

Receive<GetCurrentLifecycleStage>(stage =>
            {
                if(_currentSessionState != null)
                    Sender.Tell(_currentSessionState); //SENDER can be null!
            });

We need to make it so Sender can't be null. Solution is to do what JVM Akka does:

  /*
   * ACTOR CONTEXT IMPLEMENTATION
   */

  final def sender(): ActorRef = currentMessage match {
    case null                       system.deadLetters
    case msg if msg.sender ne null  msg.sender
    case _                          system.deadLetters
  }

Coalesce the null into Deadletters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants