Skip to content

Commit

Permalink
Fixed crash with ownership command while not having a guild selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnpn committed Aug 21, 2018
1 parent 284f118 commit 4074dbb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <user id>", nil)
return
Expand All @@ -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 {
Expand Down

0 comments on commit 4074dbb

Please sign in to comment.