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 crash in CompletionEntry #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

sharki13
Copy link

Fix for #38

From time to time there is a crash during typing something to entry, while list of options is modified basis on entered text.
While UpdateItem is executed, n.items slice is shorter than index i indicates, which lead to crash.

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Thanks - just asking what you think about a potential modification.

@@ -162,6 +162,9 @@ func newNavigableList(items []string, entry *widget.Entry, setTextFromMenu func(
fn(i, o)
return
}
if i < 0 || i >= widget.ListItemID(len(n.items)) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for this fix, but I do wonder - should we guard the fn call above as well? It won't crash immediately but we may be leading the callback to crash or get unexpected callback data...

Copy link
Member

Choose a reason for hiding this comment

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

What do you think @sharki13 could you move it so the fn callback does not get invalid data as well?

Copy link
Member

Choose a reason for hiding this comment

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

Can this questions be answered @sharki13 ? It does seem like a good thing to have fixed.

@Jacalz Jacalz changed the title Fix for https://github.com/fyne-io/fyne-x/issues/38 Fix crash in CompletionEntry Jul 12, 2023
@andydotxyz
Copy link
Member

Just pinging on this to see if the suggested change could be made so this can be landed?
Will also require rebasing to latest main as the versions have updates for checks.

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.

2 participants