-
-
Notifications
You must be signed in to change notification settings - Fork 115
Guard FileView recursion against file nodes #1661
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
Conversation
jeremypw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more complicated than necessary? I tried just checking that the item is a FolderItem in original line 224 and it seems to fix the problem. Is there a structure that fails with just this?
|
To prevent the crash, I suppose you are right. But to me, if I understand the code correctly, there might be situations where we overwalk the tree. Imagine this tree: Say It iterates over the children of Now, we wonder if the target path starts with this child's path. As Because of that prefix match, we expand The extra separator-aware check I proposed insists on With that in place, we skip I should admit that the code is a bit more complex, though. |
|
Ah, I see - good point. I wonder whether we could use |
|
Using seems to work. Unfortunately the |
963afd1 to
f2d8c2a
Compare
|
Good catch! I have updated the PR with that approach. Also, for optimisation, I have added the optional Don't hesitate if you see other possible improvements! |
jeremypw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice optimization! LGTM now.
|
Nothing in the diff that would affect flatpak and it builds as flatpak OK locally so merging. |
This is an attempt to fix #1654.
Fixes #1662