Skip to content

Commit

Permalink
Merge pull request #41 from DisgoOrg/fix/guild-nil
Browse files Browse the repository at this point in the history
fixed nil-pointer on isOwner
  • Loading branch information
topi314 authored Jun 21, 2021
2 parents 734cc16 + 638a9ab commit 2432df1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func (m Member) Guild() *Guild {

// IsOwner returns whether the member is the owner of the guild_events that it belongs to
func (m Member) IsOwner() bool {
return m.Guild().OwnerID == m.User.ID
if guild := m.Guild(); guild != nil {
return guild.OwnerID == m.User.ID
}
return false
}

// Update updates the member
Expand Down

0 comments on commit 2432df1

Please sign in to comment.