Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 02a9e01

Browse files
[fix] Resources should check type too (#488)
1 parent 40c992d commit 02a9e01

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

aspects/core.bzl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ def _bsp_target_info_aspect_impl(target, ctx):
131131
if f.is_source
132132
]
133133

134-
resources = [
135-
file_location(f)
136-
for t in getattr(ctx.rule.attr, "resources", [])
137-
for f in t.files.to_list()
138-
]
134+
resources_attr = getattr(ctx.rule.attr, "resources", [])
135+
resources = []
136+
137+
if type(resources_attr) == "list":
138+
resources = [
139+
file_location(f)
140+
for t in resources_attr
141+
for f in t.files.to_list()
142+
]
139143

140144
aspect_ids = get_aspect_ids(ctx, target)
141145

0 commit comments

Comments
 (0)