Bug 258016 [PropertiesView] NPE in org.eclipse.ui.views.properties.PropertySheetViewer
At line 720. If the selection is null this will result in an NPE. Here is the offending code snippet: 714: // get the new selection 715: TreeItem[] sel = new TreeItem[] { selection }; 716: if (sel.length == 0) { 717: setMessage(null); 718: setErrorMessage(null); 719: } else { 720: Object object = sel[0].getData(); // assume single selection It would be better replaced with the following (sorry, no patch, I'm not set up for editing the platform!): // get the new selection TreeItem sel = new TreeItem[] { selection; if (selection == null) { setMessage(null); setErrorMessage(null); } else { Object object = selection.getData(); // assume single selection if (object instanceof IPropertySheetEntry) { // get the entry for this item IPropertySheetEntry activeEntry = (IPropertySheetEntry) object; // display the description for the item setMessage(activeEntry.getDescription()); // activate a cell editor on the selection activateCellEditor(selection); } } In fact, I'm not at all sure why the selection was being wrapped in a single element array at all, I'm guessing a holdover from old code?
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetViewer.java
Map categoryCache = new HashMap(categories.length * 2 + 1);
        for (int i = 0; i < categories.length; i++) {
            categories[i].removeAllEntries();
            categoryCache.put(categories[i].getCategoryName(), categories[i]);
        }
        
        List categoriesToRemove = new ArrayList(Arrays.asList(categories));
        
        PropertySheetCategory misc = (PropertySheetCategory) categoryCache
                .get(MISCELLANEOUS_CATEGORY_NAME);
        if (misc == null) {
			misc = new PropertySheetCategory(MISCELLANEOUS_CATEGORY_NAME);
		}
        boolean addMisc = false;
        for (int i = 0; i < childEntries.size(); i++) {
            IPropertySheetEntry childEntry = (IPropertySheetEntry) childEntries
                    .get(i);
            String categoryName = childEntry.getCategory();
            if (categoryName == null) {
                misc.addEntry(childEntry);
                addMisc = true;
                categoriesToRemove.remove(misc);
            } else {
                PropertySheetCategory category = (PropertySheetCategory) categoryCache
                        .get(categoryName);
                if (category == null) {
                    category = new PropertySheetCategory(categoryName);
                    categoryCache.put(categoryName, category);
                } else {
                    categoriesToRemove.remove(category);