1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Only fetch result for jobs that has started

In certain scenarios, the WSL detect job is not launched directly. As
the join() method returns early for suspended jobs, the result list is
read too early and causing NPE.
This was deteced while running the JUnit tests.

Contributed by STMicroelectronics

Change-Id: I8a013cf83be26e8f8bee38fd2e7a4557eb1a57ab
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2021-08-15 15:11:37 +02:00
parent b9dd8152bb
commit 432ca56fd3

View file

@ -70,7 +70,7 @@ public class DetectWSL implements IDetectExternalExecutable {
detectJob.schedule();
}
try {
if (detectJob.join(10, null)) {
if (detectJob.join(10, null) && detectJob.result != null) { // Suspended jobs return early from join()
result = detectJob.result;
detectJob = null;
} else {