null pointer fix

- need to nil check before pulling value
This commit is contained in:
2025-06-19 17:28:56 -04:00
parent 7ff43c82c2
commit 71ace969d3
12 changed files with 53 additions and 31 deletions

View File

@@ -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)