From 0654eee3b1367018b84b81c93423afbc87222bff Mon Sep 17 00:00:00 2001 From: evilolipop Date: Fri, 22 Mar 2024 10:01:44 +0800 Subject: [PATCH] fix: nil pointer --- cluster/default_context.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cluster/default_context.go b/cluster/default_context.go index 3eba6f71..f8f7f9f2 100644 --- a/cluster/default_context.go +++ b/cluster/default_context.go @@ -159,7 +159,9 @@ func (dcc *DefaultContext) getPid(identity, kind string) *actor.PID { pid, _ := dcc.cluster.PidCache.Get(identity, kind) if pid == nil { pid = dcc.cluster.Get(identity, kind) - dcc.cluster.PidCache.Set(identity, kind, pid) + if pid != nil { + dcc.cluster.PidCache.Set(identity, kind, pid) + } } return pid