1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

Fix NPE, bug 191985.

This commit is contained in:
Ken Ryall 2007-06-12 12:35:46 +00:00
parent 39afec683f
commit 3ddfd0b436

View file

@ -214,11 +214,14 @@ public class ChangeBuildConfigActionBase {
if (part instanceof IEditorPart) { if (part instanceof IEditorPart) {
IEditorPart epart = (IEditorPart) part; IEditorPart epart = (IEditorPart) part;
IResource resource = (IResource) epart.getEditorInput().getAdapter(IResource.class); IResource resource = (IResource) epart.getEditorInput().getAdapter(IResource.class);
IProject project = resource.getProject(); if (resource != null)
badObject = !(project != null && CoreModel.getDefault().isNewStyleProject(project)); {
IProject project = resource.getProject();
badObject = !(project != null && CoreModel.getDefault().isNewStyleProject(project));
if (!badObject) { if (!badObject) {
fProjects.add(project); fProjects.add(project);
}
} }
} }
} }