Fix NPE in action graph dump.
RELNOTES: None
@@ -779,16 +779,20 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor {
SkyKey key = skyKeyAndNodeEntry.getKey();
SkyFunctionName functionName = key.functionName();
try {
+ SkyValue skyValue = entry.getValue();
+ // The skyValue may be null in case analysis of the previous build failed.
+ if (skyValue != null) {
if (functionName.equals(SkyFunctions.CONFIGURED_TARGET)) {
- actionGraphDump.dumpConfiguredTarget((ConfiguredTargetValue) entry.getValue());
+ actionGraphDump.dumpConfiguredTarget((ConfiguredTargetValue) skyValue);
} else if (functionName.equals(SkyFunctions.ASPECT)) {
- AspectValue aspectValue = (AspectValue) entry.getValue();
+ AspectValue aspectValue = (AspectValue) skyValue;
AspectKey aspectKey = aspectValue.getKey();
ConfiguredTargetValue configuredTargetValue =
(ConfiguredTargetValue)
memoizingEvaluator.getExistingValue(aspectKey.getBaseConfiguredTargetKey());
actionGraphDump.dumpAspect(aspectValue, configuredTargetValue);
}
+ }
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("No interruption in sequenced evaluation", e);
