[mike] fix NPE on creating new project with empty config dir

This commit is contained in:
Dmitry Jemerov
2007-04-02 18:55:45 +04:00
parent 5293cc527f
commit 332e1d58bd
2 changed files with 6 additions and 2 deletions
@@ -30,8 +30,10 @@ public class DefaultProjectStoreImpl extends ProjectStoreImpl {
myElement = projectManager.getDefaultProjectRootElement();
}
@Nullable
Element getStateCopy() {
return (Element)myProjectManager.getDefaultProjectRootElement().clone();
final Element element = myProjectManager.getDefaultProjectRootElement();
return element != null ? (Element)element.clone() : null;
}
@@ -302,7 +302,9 @@ class ProjectStoreImpl extends BaseFileConfigurableStoreImpl implements IProject
assert projectStore instanceof DefaultProjectStoreImpl;
DefaultProjectStoreImpl defaultProjectStore = (DefaultProjectStoreImpl)projectStore;
final Element element = defaultProjectStore.getStateCopy();
xmlElementStorage.setDefaultState(element);
if (element != null) {
xmlElementStorage.setDefaultState(element);
}
}
@NotNull