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