Fix NPE when Find action is unavailable in Breakpoints view#2559
Fix NPE when Find action is unavailable in Breakpoints view#2559elsazac merged 1 commit intoeclipse-platform:masterfrom
Conversation
The Find action may be unavailable when the focus is outside the Breakpoints view, which leads to an NPE in fillContextMenu. This adds a null and enablement check for the Find action to resolve the problem.
Test Results 1 980 files +1 926 1 980 suites +1 926 1h 32m 8s ⏱️ + 57m 19s Results for commit 4a502e1. ± Comparison against base commit fce9709. This pull request removes 4543 and adds 4747 tests. Note that renamed tests count towards both.This pull request removes 23 skipped tests and adds 24 skipped tests. Note that renamed tests count towards both. |
|
Merging this now; |
|
Hi @mx990, thank you for the fix! Question: there are other usages of the method
Do you know if those are safe? |
|
Hi @fedejeanne, thank you for pointing me to those other locations! I was able to produce a similar exception in the Expressions view: I was also able to produce an error in the Variables view, which does have a null check but logs an exception: I was unable to produce an exception or error in either the Modules or Launch view, but it may still be sensible to also add corresponding null checks there. |
|
I have created an additional PR #2562 to fix the NPE in the Expressions view. Please let me know if I should also change the other locations. |
|
Great, thank you for looking into it! No need to change the one in the Variables View on my account. @iloveeclipse since you made that change back then (e583bf6) WDYT? |

The Find action may be unavailable when the focus is outside the Breakpoints view, which leads to an NPE in fillContextMenu.
This adds a null and enablement check for the Find action to resolve the problem.
Fixes #2558