Avoid panics by nil pointers

This commit is contained in:
Neil Alexander 2020-08-11 15:42:41 +01:00
parent 34f4e402c8
commit 18dcb11321
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -34,8 +34,10 @@ func NewServerACLs(db storage.Database) *ServerACLs {
logrus.WithError(err).Errorf("Failed to get server ACLs for room %q", room) logrus.WithError(err).Errorf("Failed to get server ACLs for room %q", room)
continue continue
} }
if state != nil {
acls.OnServerACLUpdate(&state.Event) acls.OnServerACLUpdate(&state.Event)
} }
}
return acls return acls
} }