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

Work around the JavaFX NPE bug causing HTML5 listeners to not be called #4259

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Aug 24, 2023

Identify the Bug or Feature request

Should fix #4048

Description of the Change

There is a bug in JavaFX 19 & 20 where using the same EventListener instance across different pages with the same WebView will result in an internal NPE that prevents the EventListener from being called. This change works around that by always provided a new instance (via method reference) when registering the handler.

Possible Drawbacks

Should be none.

Documentation Notes

N/A

Release Notes

N/A


This change is Reviewable

Using a method reference creates a new `EventListener` instance each time rather than registering the same instance over
and over. This works around the JavaFX 19 & 20 bug that generates a NPE while handling events.
@cwisniew cwisniew added this pull request to the merge queue Aug 24, 2023
Merged via the queue into RPTools:develop with commit 70188e3 Aug 24, 2023
4 checks passed
@kwvanderlinde kwvanderlinde deleted the bugfix/4048-dialog-close-not-working-npe branch August 24, 2023 23:45
@cwisniew cwisniew added the bug label Aug 25, 2023
kwvanderlinde added a commit to kwvanderlinde/maptool that referenced this pull request Nov 30, 2023
HTML5 event listeners are now registered as before. However, to avoid peering issues in JavaFX <22, new listeners are
created each time the page is unloaded.
kwvanderlinde added a commit to kwvanderlinde/maptool that referenced this pull request Nov 30, 2023
HTML5 event listeners are now registered as before. However, to avoid peering issues in JavaFX <22, new listeners are
created each time the page is unloaded.
kwvanderlinde added a commit to kwvanderlinde/maptool that referenced this pull request Nov 30, 2023
HTML5 event listeners are now registered as before. However, to avoid peering issues in JavaFX <22, new listeners are
created each time the page is unloaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[Bug]: NPE preventing HTML 5 dialogs from submitting
2 participants