-
Notifications
You must be signed in to change notification settings - Fork 874
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
LSP client: Prevent NullPointerException when caret is not present on text component #5393
Conversation
Any reason not to target delivery? |
@neilcsmith-net no real one. I was not planning to get this into 17. It is not a regression and exists since a long time. I can rebase it onto delivery though. |
I'll leave it up to you. Seems a low risk fix for an annoyance? Will sync for 17-rc3 tomorrow if you do want it in. |
Observed exception: java.lang.NullPointerException: Cannot invoke "javax.swing.text.Caret.getDot()" because "this.caret" is null at java.desktop/javax.swing.text.JTextComponent.getCaretPosition(JTextComponent.java:1704) at org.netbeans.modules.lsp.client.bindings.MarkOccurrences.<init>(MarkOccurrences.java:71) at org.netbeans.modules.lsp.client.bindings.TextDocumentSyncServerCapabilityHandler.lambda$registerBackgroundTasks$6(TextDocumentSyncServerCapabilityHandler.java:330) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136) [catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
1819025
to
6543da0
Compare
@neilcsmith-net as suggested I rebased, did a quick smoke test locally, force pushed and tests are green. I retargeted this to delivery. If still fine, it would be nice to get it in. Thank you. |
Hopefully OK. |
Thank you - you made me laught 🥲 |
Thanks @matthiasblaesing merging now. |
Observed exception:
The fix is similar to this fix:
22f5827