Skip to content

Commit

Permalink
Remote: Check the return value of ActionOwner.getLabel() since it cou…
Browse files Browse the repository at this point in the history
…ld be `null`.

Fixes bazelbuild#13368.

Closes bazelbuild#13369.

PiperOrigin-RevId: 369451029
  • Loading branch information
coeuvre authored and copybara-github committed Apr 20, 2021
1 parent c9f9eed commit 4840a68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/actions:execution_requirements",
"//src/main/java/com/google/devtools/build/lib/analysis:blaze_version_info",
"//src/main/java/com/google/devtools/build/lib/authandtls",
"//src/main/java/com/google/devtools/build/lib/cmdline",
"//src/main/java/com/google/devtools/build/lib/remote:ExecutionStatusException",
"//src/main/java/com/google/devtools/build/lib/remote/common",
"//src/main/java/com/google/devtools/build/lib/remote/options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.actions.ActionExecutionMetadata;
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.remote.options.RemoteOptions;
import io.grpc.ClientInterceptor;
import io.grpc.Context;
Expand Down Expand Up @@ -65,7 +66,10 @@ public static RequestMetadata buildMetadata(
.setToolVersion(BlazeVersionInfo.instance().getVersion()));
if (actionMetadata != null) {
builder.setActionMnemonic(actionMetadata.getMnemonic());
builder.setTargetId(actionMetadata.getOwner().getLabel().getCanonicalForm());
Label label = actionMetadata.getOwner().getLabel();
if (label != null) {
builder.setTargetId(label.getCanonicalForm());
}
builder.setConfigurationId(actionMetadata.getOwner().getConfigurationChecksum());
}
return builder.build();
Expand Down

0 comments on commit 4840a68

Please sign in to comment.