Check events against nil

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
Ted Yu 2020-05-22 13:35:25 -07:00
parent 4c9571d909
commit df57a68b47

View File

@ -97,6 +97,7 @@ func (s *v2v3Store) mkV2Events(wr clientv3.WatchResponse) (evs []*v2store.Event)
key = ev
}
}
if act != nil && act.Kv != nil && key != nil {
v2ev := &v2store.Event{
Action: string(act.Kv.Value),
Node: s.mkV2Node(key.Kv),
@ -105,6 +106,7 @@ func (s *v2v3Store) mkV2Events(wr clientv3.WatchResponse) (evs []*v2store.Event)
}
evs = append(evs, v2ev)
}
}
return evs
}