From e868cbb6964e629330272284963ea2cdb22a4ced Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Wed, 3 Jun 2009 10:30:51 +0000 Subject: [PATCH] Bug 278632 - NPE in CSourceViewerConfiguration on non file:// IFileStores, patch by Andrew Eidsness --- .../org/eclipse/cdt/ui/text/CSourceViewerConfiguration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {