null pointer fix
- need to nil check before pulling value
This commit is contained in:
@@ -31,9 +31,11 @@ var destroyCmd = &cobra.Command{
|
||||
defer db.Close()
|
||||
|
||||
err = db.Destroy()
|
||||
if err.Error() == command.ErrInit {
|
||||
fmt.Println(command.ErrInitRsp)
|
||||
return
|
||||
if err != nil {
|
||||
if err.Error() == command.ErrInit {
|
||||
fmt.Println(command.ErrInitRsp)
|
||||
return
|
||||
}
|
||||
}
|
||||
cobra.CheckErr(err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user