From 5dc93e4af5b3db02016198c3b12f244fbed49c01 Mon Sep 17 00:00:00 2001 From: qupeng Date: Sun, 24 Sep 2023 17:43:44 +0800 Subject: [PATCH] kvclient(cdc): fix an out of range panic in client (#9799) (#9802) close pingcap/tiflow#9739 --- cdc/kv/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdc/kv/client.go b/cdc/kv/client.go index a3b33a38dca..21549e87798 100644 --- a/cdc/kv/client.go +++ b/cdc/kv/client.go @@ -1101,7 +1101,7 @@ func (s *eventFeedSession) receiveFromStream( } if len(cevent.Events) != 0 { - if entries, ok := cevent.Events[0].Event.(*cdcpb.Event_Entries_); ok { + if entries, ok := cevent.Events[0].Event.(*cdcpb.Event_Entries_); ok && len(entries.Entries.Entries) > 0 { commitTs := entries.Entries.Entries[0].CommitTs if maxCommitTs < commitTs { maxCommitTs = commitTs