Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavery2005-02-08 16:29:21 +0000
committerpavery2005-02-08 16:29:21 +0000
commit948da6726d8f5f62cac1979a16e3ab41566cb5a5 (patch)
treee752e62cfb78dfad9e7e5440b0e49430494f0d72 /bundles/org.eclipse.jst.jsp.core
parent2e4cb3004b51ca400313376128e1292e38a97141 (diff)
downloadwebtools.sourceediting-948da6726d8f5f62cac1979a16e3ab41566cb5a5.tar.gz
webtools.sourceediting-948da6726d8f5f62cac1979a16e3ab41566cb5a5.tar.xz
webtools.sourceediting-948da6726d8f5f62cac1979a16e3ab41566cb5a5.zip
being safer
Diffstat (limited to 'bundles/org.eclipse.jst.jsp.core')
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
index fe9adb1a4d..469c360ef2 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
@@ -402,14 +402,16 @@ class XMLJSPRegionHelper implements StructuredDocumentRegionHandler {
try {
IPath filePath = new Path(fileName);
IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
- if(!f.exists()) {
+ if(f != null && !f.exists()) {
f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(filePath);
}
- is = f.getContents();
- while ((c = is.read()) != -1) {
- count++;
- s.append((char) c);
- }
+ if (f != null && f.exists()) {
+ is = f.getContents();
+ while ((c = is.read()) != -1) {
+ count++;
+ s.append((char) c);
+ }
+ }
}
catch (Exception e) {
if (Debug.debugStructuredDocument)

Back to the top