added nil checking for communitiesManager.GetByID (#3877)
This commit is contained in:
parent
8b9ee803e2
commit
daa9ad4e05
|
@ -3024,6 +3024,9 @@ func (m *Manager) GetByID(id []byte) (*Community, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if community == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
err = community.updateCommunityDescriptionByEvents()
|
||||
if err != nil {
|
||||
|
|
|
@ -2803,6 +2803,12 @@ func (s *MessengerCommunitiesSuite) TestCheckCommunitiesToUnmute() {
|
|||
|
||||
}
|
||||
|
||||
func (s *MessengerCommunitiesSuite) TestCommunityNotInDB() {
|
||||
community, err := s.alice.communitiesManager.GetByID([]byte("0x123"))
|
||||
s.Require().Nil(err)
|
||||
s.Require().Nil(community)
|
||||
}
|
||||
|
||||
func (s *MessengerCommunitiesSuite) TestMuteAllCommunityChats() {
|
||||
// Create a community
|
||||
createCommunityReq := &requests.CreateCommunity{
|
||||
|
|
Loading…
Reference in New Issue