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