Skip to content

Commit 2f6f45a

Browse files
iancha1992fmeum
andauthored
[7.7.0] Fall back to rctx.name if $original_name is empty (#27437)
The default for the attribute is the empty string, not `null`. Fixes #25286 Closes #25296. PiperOrigin-RevId: 728298504 Change-Id: Ibc7209e248c3abb57a5fb2487e7dab7202960bbd Commit fa7900a Co-authored-by: Fabian Meumertzheim <[email protected]>
1 parent af33b4e commit 2f6f45a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package com.google.devtools.build.lib.bazel.repository.starlark;
1616

1717
import com.github.difflib.patch.PatchFailedException;
18+
import com.google.common.base.Strings;
1819
import com.google.common.collect.ImmutableMap;
1920
import com.google.common.collect.ImmutableSet;
2021
import com.google.devtools.build.docgen.annot.DocCategory;
@@ -167,7 +168,7 @@ public String getOriginalName() {
167168
// backing Bazel modules. In case of the former, the original name is the same as the name, in
168169
// the latter the original name doesn't matter as the restricted set of rules that can back
169170
// Bazel modules do not use the name.
170-
return originalName != null ? originalName : rule.getName();
171+
return Strings.isNullOrEmpty(originalName) ? rule.getName() : originalName;
171172
}
172173

173174
@StarlarkMethod(

0 commit comments

Comments
 (0)