diff --git a/src/core/Akka.Remote/RemoteWatcher.cs b/src/core/Akka.Remote/RemoteWatcher.cs index 1a5801e290d..8006f5a3f37 100644 --- a/src/core/Akka.Remote/RemoteWatcher.cs +++ b/src/core/Akka.Remote/RemoteWatcher.cs @@ -642,10 +642,13 @@ private void ProcessTerminated(IInternalActorRef watchee, bool existenceConfirme if (!addressTerminated) { - foreach (var watcher in Watching[watchee]) + if (Watching.TryGetValue(watchee, out var watchers)) { - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - watcher.SendSystemMessage(new DeathWatchNotification(watchee, existenceConfirmed, addressTerminated)); + foreach (var watcher in watchers) + { + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + watcher.SendSystemMessage(new DeathWatchNotification(watchee, existenceConfirmed, addressTerminated)); + } } }