From 03b211e6ee1b55de4e6ebd9d3547d81703bf0e43 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Fri, 1 Dec 2023 15:09:14 +0530 Subject: [PATCH] feat: fix panic Signed-off-by: Manan Gupta --- go/vt/vtctl/grpcvtctldserver/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index caa99d5e8c8..e54ee0fa96c 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -2752,7 +2752,7 @@ func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatap resp.Keyspace = ev.ShardInfo.Keyspace() resp.Shard = ev.ShardInfo.ShardName() - if !topoproto.TabletAliasIsZero(ev.NewPrimary.Alias) { + if ev.NewPrimary != nil && !topoproto.TabletAliasIsZero(ev.NewPrimary.Alias) { resp.PromotedPrimary = ev.NewPrimary.Alias } }