From 436aee58734d05cfa0b8b6f39a7cf1d89ed4d24d Mon Sep 17 00:00:00 2001 From: Devon Hudson Date: Thu, 14 Dec 2023 09:05:30 -0700 Subject: [PATCH] Check userID for nil to prevent panic --- eventauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventauth.go b/eventauth.go index ee1fd24e..0610ac0e 100644 --- a/eventauth.go +++ b/eventauth.go @@ -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) } }