Skip to content

Commit 59ba210

Browse files
committed
fix nilptr issue
1 parent b60563b commit 59ba210

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

user/cache.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ func (m *manager) findCachedUsers(ctx context.Context, query string) ([]*userpb.
6767
for _, user := range userStrings {
6868
u := userpb.User{}
6969
if err = json.Unmarshal([]byte(user), &u); err == nil {
70-
userMap[u.Id.OpaqueId] = &u
70+
if u.Id != nil && u.Id.OpaqueId != "" {
71+
userMap[u.Id.OpaqueId] = &u
72+
}
7173
}
7274
}
7375

0 commit comments

Comments
 (0)