From 0153485657aa5bc2eb6835e7cc7af685647b78d5 Mon Sep 17 00:00:00 2001 From: "AndyChen(Jingzhang)" Date: Thu, 18 Jul 2024 22:57:34 +0800 Subject: [PATCH] fix: only setFailed when actor not null (#1399) * fix: only setFailed when actor not null * chore: use ne rather than != --- actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala b/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala index 63af89af0cd..26131a979cc 100644 --- a/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala +++ b/actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala @@ -661,8 +661,7 @@ private[pekko] class ActorCell( Thread.currentThread().interrupt() throw ActorInitializationException(self, "interruption during creation", e) case NonFatal(e) => - if (actor == null) setFailed(system.deadLetters) - else setFailed(actor.self) + if (actor ne null) setFailed(actor.self) failActor() e match { case i: InstantiationException =>