Skip to content

Commit

Permalink
fix: fix no metadata database found
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Dec 28, 2023
1 parent 38616d2 commit 4a302d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pitr/cli/internal/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func checkDatabaseExist(proxy pkg.IShardingSphereProxy, bak *model.LsBackup) err
return xerr.NewCliErr(fmt.Sprintf("get cluster metadata failed. err: %s", err))
}

if clusterNow.MetaData.Databases == nil {
return xerr.NewCliErr(fmt.Sprintf("no cluster metadata database found. err: %s", err))
}

for k := range clusterNow.MetaData.Databases {
databaseNamesExist = append(databaseNamesExist, k)
}
Expand Down

0 comments on commit 4a302d1

Please sign in to comment.