diff options
author | Laurent Le Brun <laurentlb@google.com> | 2015-06-16 14:33:08 +0000 |
---|---|---|
committer | John Field <jfield@google.com> | 2015-06-17 15:21:40 +0000 |
commit | 65292359e1697aa7c6ce7eba6b462f25578c5011 (patch) | |
tree | 74d962dac4a7acca8de08cc8dfcb216ad5103e94 /src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java | |
parent | 0856b58ffb5f21122ff5c066a23ba2446c89248e (diff) |
Skylark: Late-bound attributes may return None.
--
MOS_MIGRATED_REVID=96106406
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java index b7bd55e3f3..1000c3e40f 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java @@ -41,6 +41,7 @@ import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.Type; import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey; import com.google.devtools.build.lib.syntax.EvalException; +import com.google.devtools.build.lib.syntax.EvalUtils; import com.google.devtools.build.lib.syntax.Label; import java.util.ArrayList; @@ -381,12 +382,13 @@ public abstract class DependencyResolver { // TODO(bazel-team): We should check if the implementation tries to access an undeclared // fragment. Object actualValue = lateBoundDefault.getDefault(rule, actualConfig); + if (EvalUtils.isNullOrNone(actualValue)) { + continue; + } if (attribute.getType() == Type.LABEL) { Label label; label = Type.LABEL.cast(actualValue); - if (label != null) { - builder.put(attribute, LabelAndConfiguration.of(label, actualConfig)); - } + builder.put(attribute, LabelAndConfiguration.of(label, actualConfig)); } else if (attribute.getType() == Type.LABEL_LIST) { for (Label label : Type.LABEL_LIST.cast(actualValue)) { builder.put(attribute, LabelAndConfiguration.of(label, actualConfig)); |