Skip to content

Commit

Permalink
fix: ipfs mount crashing if there was no name published before
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Kubuxu committed Mar 2, 2017
1 parent 57e4e21 commit 8308631
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fuse/ipns/ipns_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import (
core "github.com/ipfs/go-ipfs/core"
dag "github.com/ipfs/go-ipfs/merkledag"
mfs "github.com/ipfs/go-ipfs/mfs"
namesys "github.com/ipfs/go-ipfs/namesys"
path "github.com/ipfs/go-ipfs/path"
ft "github.com/ipfs/go-ipfs/unixfs"
uio "github.com/ipfs/go-ipfs/unixfs/io"

ci "gx/ipfs/QmNiCwBNA8MWDADTFVq1BonUEJbS2SvjAoNkZZrhEwcuUi/go-libp2p-crypto"
logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
Expand Down Expand Up @@ -95,7 +97,11 @@ func loadRoot(ctx context.Context, rt *keyRoot, ipfs *core.IpfsNode, name string
}

node, err := core.Resolve(ctx, ipfs.Namesys, ipfs.Resolver, p)
if err != nil {
switch err {
case nil:
case namesys.ErrResolveFailed:
node = uio.NewEmptyDirectory()
default:
log.Errorf("looking up %s: %s", p, err)
return nil, err
}
Expand Down

0 comments on commit 8308631

Please sign in to comment.