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

fix(io): handle relative paths in Watcher by converting to absolute p… #3553

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SanjayUG
Copy link

Fix: Handle Relative Paths in Watcher by Converting to Absolute Paths

Which issue does this PR close?

Rationale for this change

This update fixes a NullPointerException (NPE) that occurs when watching files with relative paths by converting them to absolute paths before registration. This ensures that the file watcher can handle relative paths correctly.

What changes are included in this PR?

  • fix(io): Handle relative paths in Watcher by converting to absolute paths
    • Fixes NPE when watching files with relative paths by converting them to absolute paths before registration.

Are these changes tested?

Yes, the changes are tested to ensure that the Watcher can handle relative paths without causing a NullPointerException.

Are there any user-facing changes?

No, there are no user-facing changes as this update is related to internal path handling improvements.

Are there any breaking changes to public APIs?

No, there are no breaking changes to public APIs.

Additional Information

Thanks for opening a PR!

If the CI build fails due to Scalafmt, run sbt scalafmtAll and push the changes (generally a good idea to run this prior to opening the PR).

It's also helpful to run sbt prePR, which runs tests, generates docs, and performs various checks.

Feel free to ask questions on the fs2 and fs2-dev channels on the Typelevel Discord server.

@mpilquist
Copy link
Member

Thanks for the PR. The description states tests were updated but looks like those changes were not included. Can you update tests and run scalafmt?

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

Successfully merging this pull request may close these issues.

fs2.io.Watcher#watch with a relative path to file causes an NPE
2 participants