diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/CSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/CSourceViewerConfiguration.java index 50483fe578f..bdd3d622f9f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/CSourceViewerConfiguration.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/CSourceViewerConfiguration.java @@ -957,7 +957,9 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration { ILocationProvider locationProvider = (ILocationProvider)input.getAdapter(ILocationProvider.class); if (locationProvider != null) { IPath path = locationProvider.getPath(input); - contentType = CCorePlugin.getContentType(path.lastSegment()); + if (path != null) { + contentType = CCorePlugin.getContentType(path.lastSegment()); + } } } if (contentType != null) {