Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarc-Andre Laperle2020-09-25 00:47:48 -0400
committerMarc-André Laperle2020-09-26 22:28:03 -0400
commit2015e9b00901b785bce222d58f02f7009f943a1b (patch)
tree67468996a66f01f28104bd3a68a3dfed725e19eb /build
parentf2761aa76c4cb65b8ea91e53a2ed05e982e2decf (diff)
downloadorg.eclipse.cdt-2015e9b00901b785bce222d58f02f7009f943a1b.tar.gz
org.eclipse.cdt-2015e9b00901b785bce222d58f02f7009f943a1b.tar.xz
org.eclipse.cdt-2015e9b00901b785bce222d58f02f7009f943a1b.zip
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>
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
index 36fdfed7181..23a6c3fed8e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
@@ -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.
// So instead, restart the whole thing with the corresponding CompilationDatabaseParser instance in the writable config.
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()
.getProjectDescription(project.getProject(), true);
ICConfigurationDescription writableCfg = projectDescription

Back to the top