fix: only setFailed when actor not null (#1399)

* fix: only setFailed when actor not null

* chore: use ne rather than !=
This commit is contained in:
AndyChen(Jingzhang) 2024-07-18 22:57:34 +08:00 committed by GitHub
parent 73c93622f1
commit 0153485657
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 =>