mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-23 18:34:02 +02:00
Handled err in acse of lack of user-channel membership (#3378)
* Handled err in acse of lack of user-channel membership * Used errors.As instead of type check Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
parent
95b65dba22
commit
36a073eaad
@ -669,8 +669,16 @@ func (s *MattermostAuthLayer) GetMemberForBoard(boardID, userID string) (*model.
|
|||||||
if b.ChannelID != "" {
|
if b.ChannelID != "" {
|
||||||
_, err := s.servicesAPI.GetChannelMember(b.ChannelID, userID)
|
_, err := s.servicesAPI.GetChannelMember(b.ChannelID, userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
var appErr *mmModel.AppError
|
||||||
|
if errors.As(err, &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, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &model.BoardMember{
|
return &model.BoardMember{
|
||||||
BoardID: boardID,
|
BoardID: boardID,
|
||||||
UserID: userID,
|
UserID: userID,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user