Skip to content

Commit 46e9ba2

Browse files
committed
fix panic if no command
1 parent ca44dca commit 46e9ba2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/pbm/diagnostic.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ func handleDiagnostic(
7373
"failed to save %s", filepath.Join(opts.path, prefix+".report.json"))
7474
}
7575

76-
switch report.Command.Cmd {
76+
var cmdType sdk.CommandType
77+
if report.Command != nil {
78+
cmdType = report.Command.Cmd
79+
}
80+
switch cmdType {
7781
case sdk.CmdBackup:
7882
meta, err := pbm.GetBackupByOpID(ctx, opts.opid, sdk.GetBackupByNameOptions{})
7983
if err != nil {

0 commit comments

Comments
 (0)