| Summary: | [target] NPE in TargetContentsGroup.getBundleChildren | ||
|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Jeff McAffer <jeffmcaffer> |
| Component: | UI | Assignee: | PDE-UI-Inbox <pde-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | 3.7 | ||
| Target Milestone: | 3.7 M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Jeff, is this something that will be integrated into bug 331068? yes, this fix is included in the patch with bug 331068. Fixed with bug 331068 |
TargetContentsGroup.getBundleChildren calls to IBundleContainer container = (IBundleContainer) parent; return container.getBundles(); getBundles can return null but callers of getBundleChildren are not expecting null. Changing the method to read private Object[] getBundleChildren(Object parent) { Object[] result = null; if (parent == null) { result = fAllBundles.toArray(); } else if (fFeaureModeButton.getSelection() && parent == OTHER_CATEGORY) { result = ((TargetDefinition) fTargetDefinition).getOtherBundles(); } else if (fGrouping == GROUP_BY_CONTAINER && parent instanceof IBundleContainer) { IBundleContainer container = (IBundleContainer) parent; result = container.getBundles(); } else if (fGrouping == GROUP_BY_FILE_LOC && parent instanceof IPath) { List bundles = (List) getFileBundleMapping().get(parent); if (bundles != null && bundles.size() > 0) { result = bundles.toArray(); } } if (result == null) { return new Object[0]; } return result; } Here the two returns in the if/else statements were changed to result = . Then the pre-existing check at the end converts null to an empty object.