Bug 199134 - NPE in Extensions Section
Summary: NPE in Extensions Section
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-08-07 14:16 EDT by Brian Bauman CLA
Modified: 2007-08-07 15:38 EDT (History)
1 user (show)

See Also:


Attachments
patch (996 bytes, patch)
2007-08-07 14:46 EDT, Adam Archer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bauman CLA 2007-08-07 14:16:18 EDT
I20070807-0100

java.lang.NullPointerException
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection.getCustomImage(ExtensionsSection.java:750)
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection.resolveObjectImage(ExtensionsSection.java:716)
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection.access$1(ExtensionsSection.java:709)
	at org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection$ExtensionLabelProvider.getImage(ExtensionsSection.java:149)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getImage(WrappedViewerLabelProvider.java:117)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:165)
.....

An attribute of type resource can specify either an file or folder.  If it is a folder, I believe the file extension is null, causing the NPE.  This appears to be a small side effect from bug 198305.
Comment 1 Adam Archer CLA 2007-08-07 14:46:44 EDT
Created attachment 75560 [details]
patch

Nice catch Brian.

This patch adds a null guard before checking if the resource is a valid image. If the extension is null, the resource must not be a valid image and the default is used (null is returned).
Comment 2 Brian Bauman CLA 2007-08-07 15:34:36 EDT
Committed.  Thanks for the quick turn around Adam.  

PDE is looking so pretty these days.