From 239e8507c3a612e23291a85bed2106915dec276a Mon Sep 17 00:00:00 2001 From: Mykola Semko Date: Tue, 28 Sep 2021 08:01:47 -0700 Subject: [PATCH] HybridLocalStrategy: NPE fix while canceling delegating job Summary: ^ Reviewed By: cjhopman fbshipit-source-id: c5a8f0b81835e80e680ba1cb4b0a8c7b291928f8 --- .../buck/rules/modern/builders/HybridLocalStrategy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/facebook/buck/rules/modern/builders/HybridLocalStrategy.java b/src/com/facebook/buck/rules/modern/builders/HybridLocalStrategy.java index d5c5bed30d4..8cb63877942 100644 --- a/src/com/facebook/buck/rules/modern/builders/HybridLocalStrategy.java +++ b/src/com/facebook/buck/rules/modern/builders/HybridLocalStrategy.java @@ -278,6 +278,10 @@ public ListenableFuture rescheduleLocally(Throwable reason) { public boolean cancelDelegateLocked(Throwable reason) { Verify.verify(Thread.holdsLock(this)); + if (delegateResult == null) { + LOG.debug("Nothing to cancel."); + return false; + } StrategyBuildResult capturedDelegateResult = Objects.requireNonNull(delegateResult); if (capturedDelegateResult.getBuildResult().isDone()) {