🐛 Fix event new null pointer exception

This commit is contained in:
LittleSheep 2024-11-17 14:27:55 +08:00
parent 461d4c0e70
commit 614509740b

View File

@ -93,7 +93,7 @@ func NewEvent(event models.Event) (models.Event, error) {
if strings.HasPrefix(event.Type, "messages") { if strings.HasPrefix(event.Type, "messages") {
event.Channel, _ = GetChannel(event.ChannelID) event.Channel, _ = GetChannel(event.ChannelID)
if event.Channel.RealmID == nil { if event.Channel.RealmID != nil {
realm, err := authkit.GetRealm(gap.Nx, *event.Channel.RealmID) realm, err := authkit.GetRealm(gap.Nx, *event.Channel.RealmID)
if err == nil { if err == nil {
event.Channel.Realm = &realm event.Channel.Realm = &realm