Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2007-10-19 18:41:05 +0000
committergkessler2007-10-19 18:41:05 +0000
commit016abae649f17a35d5e34fea297154f362a81a99 (patch)
tree7b5b006806bb1a4c4157a299981d144032655ef2
parentc32c1822de6c75031c123534f413724dc4a89fb0 (diff)
downloadwebtools.jsf-016abae649f17a35d5e34fea297154f362a81a99.tar.gz
webtools.jsf-016abae649f17a35d5e34fea297154f362a81a99.tar.xz
webtools.jsf-016abae649f17a35d5e34fea297154f362a81a99.zip
[206541] java.lang.NullPointerException occurs in JSFFacetInstallDataModelProvider after JSF configuration is selected in Dynamic Web Project wizard
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java
index 1c7b7db85..e034c9d11 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFFacetInstallDataModelProvider.java
@@ -261,6 +261,9 @@ public class JSFFacetInstallDataModelProvider extends
private IProject getProject(){
String projName = (String)getProperty(FACET_PROJECT_NAME);
+ if (projName == null || "".equals(projName))
+ return null;
+
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
return project;
}
@@ -285,13 +288,14 @@ public class JSFFacetInstallDataModelProvider extends
return OK_STATUS;
}
- private IPath getProjectPath() {
- String projName = (String)getProperty(FACET_PROJECT_NAME);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- if (project.exists()){
+ private IPath getProjectPath() {
+ IProject project = getProject();
+ if (project == null)
+ return null;
+ else if (project.exists())
return project.getLocation();
- }
+ String projName = (String)getProperty(FACET_PROJECT_NAME);
IDataModel projModel = (IDataModel)getProperty(MASTER_PROJECT_DM);
if (projModel.getBooleanProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION)){
return new Path(projModel.getStringProperty(IProjectCreationPropertiesNew.PROJECT_LOCATION)).append(projName);

Back to the top