Additional fix for GetMemberForBoard returning nil,nil (#3570)

* fix panic

* remove else
This commit is contained in:
Scott Bishel 2022-08-04 14:30:25 -06:00 committed by GitHub
parent cdcc50e075
commit 97818c3915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -695,7 +695,7 @@ func (s *MattermostAuthLayer) GetMemberForBoard(boardID, userID string) (*model.
if errors.As(memberErr, &appErr) && appErr.StatusCode == http.StatusNotFound {
// Plugin API returns error if channel member doesn't exist.
// We're fine if it doesn't exist, so its not an error for us.
return nil, nil
return nil, model.NewErrNotFound(userID)
}
return nil, memberErr
@ -712,7 +712,8 @@ func (s *MattermostAuthLayer) GetMemberForBoard(boardID, userID string) (*model.
Synthetic: true,
}, nil
}
} else {
}
if err != nil {
return nil, err
}
return bm, nil