Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item(id) panics in local implementation if the id is not a correct path #262

Open
acabarbaye opened this issue Oct 7, 2022 · 0 comments

Comments

@acabarbaye
Copy link

in https://github.com/graymeta/stow/blob/973a61f346d598a566affb53c4698764a67df164/local/container.go#L132

info, err := os.Stat(path)
	if os.IsNotExist(err) {
		return nil, stow.ErrNotFound
	}
	if info.IsDir() {
		return nil, errors.New("unexpected directory")
	}

if the stat fails because the path is not valid and so if the error is differetn than not exist, info is nil and so the line info.IsDir panics with runtime error: invalid memory address or nil pointer dereference

The correct behaviour should be to return an error if stat fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant