Skip to content

Commit

Permalink
fix if ks meta is nil
Browse files Browse the repository at this point in the history
Signed-off-by: ystaticy <[email protected]>
  • Loading branch information
ystaticy committed Dec 25, 2024
1 parent eebd344 commit 7da9818
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/locate/pd_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func NewCodecPDClientWithKeyspace(mode apicodec.Mode, client pd.Client, keyspace

// NewCodecPDClientWithKeyspaceMeta creates a CodecPDClient in API v2 with keyspace name.
func NewCodecPDClientWithKeyspaceMeta(mode apicodec.Mode, client pd.Client, keyspaceMeta *keyspacepb.KeyspaceMeta) (*CodecPDClient, error) {
if keyspaceMeta == nil {
return NewCodecPDClient(mode, client), nil
}

codec, err := apicodec.NewCodecV2(mode, keyspaceMeta)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7da9818

Please sign in to comment.