From 6dabffb46c67f5433a030e73fe7ffd96337650fa Mon Sep 17 00:00:00 2001 From: mavolin <48887425+mavolin@users.noreply.github.com> Date: Sun, 18 Oct 2020 22:37:01 +0200 Subject: [PATCH] State: fix case where Role would return nil error, even though no role was found --- state/state.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/state/state.go b/state/state.go index 8ea9c22..e6de2c6 100644 --- a/state/state.go +++ b/state/state.go @@ -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 }