提交 c5318e89 作者: Jeromy

type check to avoid panic

License: MIT
Signed-off-by: 's avatarJeromy <why@ipfs.io>
上级 921ae0e9
......@@ -162,7 +162,13 @@ included in the output of this command.
return
}
delete(cfg["Identity"].(map[string]interface{}), "PrivKey")
idmap, ok := cfg["Identity"].(map[string]interface{})
if !ok {
res.SetError(fmt.Errorf("config has no identity"), cmds.ErrNormal)
return
}
delete(idmap, "PrivKey")
output, err := config.HumanOutput(cfg)
if err != nil {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论