mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
type check to avoid panic
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
@ -162,7 +162,13 @@ included in the output of this command.
|
|||||||
return
|
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)
|
output, err := config.HumanOutput(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user