check if event is nil

This commit is contained in:
Asim Aslam 2020-01-23 12:41:22 +00:00
parent 77c2a021da
commit ae08e9c106

View File

@ -655,6 +655,11 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
var events []*router.Event
for _, event := range pbRtrAdvert.Events {
// for backwards compatibility reasons
if event == nil || event.Route == nil {
continue
}
// we know the advertising node is not the origin of the route
if pbRtrAdvert.Id != event.Route.Router {
// if the origin router is not the advertising node peer