Skip to content

Commit

Permalink
Check userID for nil to prevent panic
Browse files Browse the repository at this point in the history
  • Loading branch information
devonh committed Dec 14, 2023
1 parent e97395e commit 436aee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (a *allowerContext) powerLevelsEventAllowed(event PDU) error {
if err != nil {
return err
}
if !isValidUserID(sender.String()) {
if sender == nil || !isValidUserID(sender.String()) {
return errorf("Not a valid user ID: %q", senderID)
}
}
Expand Down

0 comments on commit 436aee5

Please sign in to comment.