Skip to content

Commit

Permalink
share: fixed another possible panic in GetShare
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Nov 4, 2024
1 parent 165a578 commit 189e3dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions share/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ func (m *mgr) GetShare(ctx context.Context, ref *collaboration.ShareReference) (
err = errtypes.NotFound(ref.String())
}

// resolve grantee's user type
s.Grantee.GetUserId().Type, _ = m.getUserType(ctx, s.Grantee.GetUserId().OpaqueId)
// resolve grantee's user type if applicable
if s.Grantee.Type == provider.GranteeType_GRANTEE_TYPE_USER {
s.Grantee.GetUserId().Type, _ = m.getUserType(ctx, s.Grantee.GetUserId().OpaqueId)
}

path, err := m.getPath(ctx, s.ResourceId)
if err != nil {
Expand Down

0 comments on commit 189e3dd

Please sign in to comment.