Skip to content

fix: throw ENOTDIR when trying to open an incorrect path (nested under existing file) - #282

Merged
tschaub merged 1 commit into
tschaub:masterfrom
niieani:fix-nested-access
Nov 25, 2019
Merged

fix: throw ENOTDIR when trying to open an incorrect path (nested under existing file)#282
tschaub merged 1 commit into
tschaub:masterfrom
niieani:fix-nested-access

Conversation

@niieani

@niieani niieani commented Nov 19, 2019

Copy link
Copy Markdown
Contributor

If you have a file: /mock-dir/two.txt and try to open /mock-dir/two.txt/bogus-path, you would get item.getItem is not a function Error due to item instance being a File, not a Directory.

This adds a fix to this by checking the instance of resolved item and throwing accordingly.

This matches node's native behavior in such a case.

…r existing file)

If you have a file: /mock-dir/two.txt and try to open /mock-dir/two.txt/bogus-path, you would get `item.getItem is not a function` due to `item` instance being a File. This adds a fix to this by checking the instance of resolved `item` and throwing accordingly. This matches node's native behavior in such a case.
@tschaub
tschaub merged commit 98ba9b6 into tschaub:master Nov 25, 2019
@tschaub

tschaub commented Nov 25, 2019

Copy link
Copy Markdown
Owner

Thanks, @niieani.

@3cp

3cp commented Nov 26, 2019

Copy link
Copy Markdown
Collaborator

@tschaub I think you missed the acknowledgement in change log.

@tschaub

tschaub commented Nov 26, 2019

Copy link
Copy Markdown
Owner

Good catch @3cp. Added in ad93ac5.

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.

3 participants