From 4074dbbf26f1edfe60d08f4f0db50ee5e4e2093f Mon Sep 17 00:00:00 2001 From: Mnpn03 Date: Tue, 21 Aug 2018 18:20:20 +0200 Subject: [PATCH] Fixed crash with ownership command while not having a guild selected. --- commands.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 3eb189b..f89e7da 100644 --- a/commands.go +++ b/commands.go @@ -774,6 +774,11 @@ func commandRaw(session *discordgo.Session, source commandSource, cmd string, ar aliases[strings.ToLower(args[0])] = strings.Join(args[1:], " ") } case "ownership": + if loc.guild == nil { + stdutil.PrintErr(tl("invalid.guild"), nil) + return + } + if nargs < 1 { stdutil.PrintErr("ownership ", nil) return @@ -784,11 +789,6 @@ func commandRaw(session *discordgo.Session, source commandSource, cmd string, ar stdutil.PrintErr(tl("invalid.not.owner"), nil) return } - - if loc.guild == nil { - stdutil.PrintErr(tl("invalid.guild"), nil) - return - } member, err := session.State.Member(loc.guild.ID, id) if err != nil {