fix: snapshot commands panic if snapshot don't exists (#16138)
This commit is contained in:
@@ -3,6 +3,7 @@ package snapshot
|
||||
import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -48,6 +49,10 @@ func DumpArchiveCmd() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
if snapshot == nil {
|
||||
return errors.New("snapshot don't exists")
|
||||
}
|
||||
|
||||
bz, err := snapshot.Marshal()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user