1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 09:52:20 +08:00

fix panic caused by accessing config after repo closed

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-09-03 09:28:36 -07:00
parent 3fc1854d24
commit ab0c668ab8
14 changed files with 84 additions and 41 deletions

View File

@ -204,7 +204,13 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
return
}
if routingOption == routingOptionSupernodeKwd {
servers, err := repo.Config().SupernodeRouting.ServerIPFSAddrs()
rcfg, err := repo.Config()
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
servers, err := rcfg.SupernodeRouting.ServerIPFSAddrs()
if err != nil {
res.SetError(err, cmds.ErrNormal)
repo.Close() // because ownership hasn't been transferred to the node