From 6fc15d4f7af5f1cb01dcc35afda2179eec66a859 Mon Sep 17 00:00:00 2001 From: pluto <2631223275@qq.com> Date: Thu, 31 Aug 2023 16:58:40 +0800 Subject: [PATCH] refactor:Returns [] an empty array when no platform is online, instead of null (#970) --- pkg/common/db/cache/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go index 61b4df9d8..2db5e2190 100644 --- a/pkg/common/db/cache/user.go +++ b/pkg/common/db/cache/user.go @@ -244,7 +244,7 @@ func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineS } if newPlatformIDs == nil { onlineStatus.Status = constant.Offline - onlineStatus.PlatformIDs = nil + onlineStatus.PlatformIDs = []int32{} newjsonData, err := json.Marshal(&onlineStatus) if err != nil { return errs.Wrap(err)