State: fix case where Role would return nil error, even though no role was found

This commit is contained in:
mavolin 2020-10-18 22:37:01 +02:00 committed by diamondburned
parent 1bec57523d
commit 6dabffb46c
1 changed files with 4 additions and 0 deletions

View File

@ -636,6 +636,10 @@ func (s *State) Role(guildID discord.GuildID, roleID discord.RoleID) (*discord.R
}
}
if role == nil {
return nil, ErrStoreNotFound
}
return role, nil
}