Skip to content

Commit 799c9bb

Browse files
authored
Fix possible nil pointer dereference if res is nil. (#38)
1 parent 55650a5 commit 799c9bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/connector/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (o *userResourceType) List(ctx context.Context, parentID *v2.ResourceId, pt
151151
u, res, err := o.client.Users.GetByID(ctx, user.GetID())
152152
if err != nil {
153153
// This undocumented API can return 404 for some users. If this fails it means we won't get some of their details like email
154-
if res.StatusCode != http.StatusNotFound {
154+
if res == nil || res.StatusCode != http.StatusNotFound {
155155
return nil, "", nil, err
156156
}
157157
l.Error("error fetching user by id", zap.Error(err), zap.Int64("user_id", user.GetID()))

0 commit comments

Comments
 (0)