Check for malformed artifact names before dereferencing them.
Fixes: https://github.com/openwrt/openwrt/commit/5816d883ff3884ae96c3293b316f6d56c099eee0
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22385
Signed-off-by: Robert Marko <robimarko@gmail.com>
output[artifact] = {}
for file in files:
file = str(file.name)
- arch = re.match(r".*Linux-([^.]*)\.", file).group(1)
- output[artifact][arch] = file
+ arch = re.match(r".*Linux-([^.]*)\.", file)
+ if arch:
+ output[artifact][arch.group(1)] = file
for json_file in work_dir.glob("*.json"):