Add fail fast checks to prevent null message, see #2800

(cherry picked from commit 5526f9d2a8b01f944ff078ce57f2a03c21649d05)

* Added null check in Envelope.apply
This commit is contained in:
Patrik Nordwall 2013-02-20 11:42:29 +01:00
parent b2cd087ac6
commit 0f01ffe3a0
7 changed files with 21 additions and 10 deletions

View file

@ -355,8 +355,10 @@ private[akka] class RemoteActorRef private[akka] (
def sendSystemMessage(message: SystemMessage): Unit = try remote.send(message, None, this) catch handleException
override def !(message: Any)(implicit sender: ActorRef = Actor.noSender): Unit =
override def !(message: Any)(implicit sender: ActorRef = Actor.noSender): Unit = {
if (message == null) throw new InvalidMessageException("Message is null")
try remote.send(message, Option(sender), this) catch handleException
}
def start(): Unit = if (props.isDefined && deploy.isDefined) provider.useActorOnNode(path, props.get, deploy.get, getParent)