[345464 revert] WorkspaceFileHyperlink throws Null Pointer Exception for tag attribute values which contain path to image file
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index 0a8d3d1..a29548e 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -12,7 +12,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.osgi.util.NLS;
@@ -88,8 +87,7 @@
}
private String getEditorLabel() throws CoreException {
- final IContentDescription description = fFile.getContentDescription();
- final IEditorDescriptor defaultEditor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(fFile.getName(), description != null ? description.getContentType() : null);
+ final IEditorDescriptor defaultEditor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(fFile.getName(), fFile.getContentDescription().getContentType());
return defaultEditor != null ? defaultEditor.getLabel() : null;
}