mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 567334 - Occasional NPE in CompilationDatabaseParser
Make sure the project is still accessible before doing the work. It's possible that the project got closed before the job had a chance to start. Change-Id: If02e818394502397e8958d18284160d4f08ca195 Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
This commit is contained in:
parent
f2761aa76c
commit
2015e9b009
1 changed files with 5 additions and 0 deletions
|
@ -398,6 +398,11 @@ public class CompilationDatabaseParser extends LanguageSettingsSerializableProvi
|
||||||
// saved that is not stored in the project description (i.e. calls to setProperties) will be saved to the wrong instance so when we call setProjectDescription, our changes will be ignored.
|
// saved that is not stored in the project description (i.e. calls to setProperties) will be saved to the wrong instance so when we call setProjectDescription, our changes will be ignored.
|
||||||
// So instead, restart the whole thing with the corresponding CompilationDatabaseParser instance in the writable config.
|
// So instead, restart the whole thing with the corresponding CompilationDatabaseParser instance in the writable config.
|
||||||
IProject project = cfgDescription.getProjectDescription().getProject();
|
IProject project = cfgDescription.getProjectDescription().getProject();
|
||||||
|
if (!project.isAccessible()) {
|
||||||
|
// Project was probably closed while the job was waiting to start.
|
||||||
|
return Status.CANCEL_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
ICProjectDescription projectDescription = CCorePlugin.getDefault().getCoreModel()
|
ICProjectDescription projectDescription = CCorePlugin.getDefault().getCoreModel()
|
||||||
.getProjectDescription(project.getProject(), true);
|
.getProjectDescription(project.getProject(), true);
|
||||||
ICConfigurationDescription writableCfg = projectDescription
|
ICConfigurationDescription writableCfg = projectDescription
|
||||||
|
|
Loading…
Add table
Reference in a new issue