Skip to content

Commit bdaefa6

Browse files
author
angelozerr
committed
Fix NPE when project location is null.
1 parent 435c445 commit bdaefa6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

eclipse/ts.eclipse.ide.core/src/ts/eclipse/ide/internal/core/resources/IDEResourcesManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ public static IDEResourcesManager getInstance() {
4747
public IDETypeScriptProject getTypeScriptProject(Object obj, boolean force) throws IOException {
4848
if (obj instanceof IProject) {
4949
IProject project = (IProject) obj;
50+
if (project.getLocation() == null) {
51+
return null;
52+
}
5053
try {
5154
if (force) {
5255
// Dispose TypeScript project if exists
@@ -62,7 +65,7 @@ public IDETypeScriptProject getTypeScriptProject(Object obj, boolean force) thro
6265
return tsProject;
6366
} catch (Exception ex) {
6467
Trace.trace(Trace.SEVERE,
65-
"Error while creating TypeScript ptoject [" + project.getName() + "]: " + ex.getMessage(), ex);
68+
"Error while creating TypeScript project [" + project.getName() + "]: " + ex.getMessage(), ex);
6669
}
6770
}
6871
return null;

0 commit comments

Comments
 (0)