Skip to content

Commit

Permalink
fix nil ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
nikooo777 committed Jan 29, 2024
1 parent 769c1dc commit e23eb38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/services/v1/comments/abandon.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func abandon(args *commentapi.AbandonArgs) (*commentapi.CommentItem, error) {
if comment.R.Channel == nil {
return nil, errors.Err("channel id '%s' does not have a channel record", comment.ChannelID.String)
}
commenterChannel = comment.R.Channel
// Handle anonymous content where there's no channel associated
if args.CreatorChannelID == "" && args.CreatorChannelName == "" {
// If the content is anonymous, set the modChannel to a default or system channel
Expand All @@ -38,9 +39,8 @@ func abandon(args *commentapi.AbandonArgs) (*commentapi.CommentItem, error) {
return nil, err
}
}
} else {
commenterChannel = comment.R.Channel
}

// Old versions of desktop app will allow for just creator channel info to be sent for creators to
// delete comments and mod channel info is newer addition and would not be sent so we cannot assume
// it will sent with request.
Expand Down

0 comments on commit e23eb38

Please sign in to comment.