Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Reproduced the original issue by triggering the condition where an uninitialized WorkingDirectory is passed to GetLayoutPreferencesForPath during setting change events.
  2. Verified that the path.StartsWith() method throws a NullReferenceException without the fix.
  3. Applied the fix by adding checks to prevent applying default layout preferences when the path is null or empty.
  4. Confirmed that the NullReferenceException is no longer thrown after applying the fix.
  5. Tested with various scenarios involving empty paths and uninitialized WorkingDirectory to ensure the fix handles all cases.
  6. Ensured that the application functions as expected and no unexpected behavior occurs when dealing with empty paths or uninitialized WorkingDirectory.

@yaira2 yaira2 requested a review from hishitetsu November 10, 2025 00:26
@yaira2 yaira2 added the ready for review Pull requests that are ready for review label Nov 10, 2025
Copy link
Member

@hishitetsu hishitetsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think simply checking for null should be sufficient.

yaira2 and others added 3 commits November 12, 2025 09:40
Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com>
Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com>
Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com>
Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com>
Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com>
Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com>
@yaira2 yaira2 merged commit 31362f4 into main Nov 12, 2025
9 checks passed
@yaira2 yaira2 deleted the seer/fix/empty-path-layout-preferences branch November 12, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants