diff --git a/core/pathresolver.go b/core/pathresolver.go index 367b82001d70deddbec364d277f7e397d3472b06..08bbac0e3d390dd1691d527135b729d0e505a078 100644 --- a/core/pathresolver.go +++ b/core/pathresolver.go @@ -29,6 +29,10 @@ func Resolve(ctx context.Context, n *IpfsNode, p path.Path) (*merkledag.Node, er } seg := p.Segments() + if len(seg) < 2 { + return nil, errors.New("No path given") + } + extensions := seg[2:] resolvable, err := path.FromSegments("/", seg[0], seg[1]) if err != nil {