Project: Eclipse_Platform_UI
Bug 262022 [FieldAssist] ContentProposalAdapter.recomputeProposals might throw a NPE
Reported: 2009-01-22 10:14:14 | Status: verified fixed

When a control using content proposal gets disposed during usage the recomputeProposals() method might throw a NPE. This is caused by getting "allProposals" using a call to getProposals() which is allowed to return null. When using allProposals.length this will crash. I'm not sure if the simple solution if ((allProposals == null) || (allProposals.length == 0) { proposals = new IContentProposal[0]; close(); } else { // cont. will work or if the popup will have problems with a disposed control.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/fieldassist/FieldAssistTestCase.java