diff --git a/changelog.d/pr-217.md b/changelog.d/pr-217.md new file mode 100644 index 00000000..66b1a13a --- /dev/null +++ b/changelog.d/pr-217.md @@ -0,0 +1,3 @@ +### 🐛 Bug Fixes + +- BF: make it [] in case of None being returned. [PR #217](https://github.com/datalad/datalad-container/pull/217) (by [@yarikoptic](https://github.com/yarikoptic)) diff --git a/datalad_container/adapters/docker.py b/datalad_container/adapters/docker.py index 598cca24..89498527 100644 --- a/datalad_container/adapters/docker.py +++ b/datalad_container/adapters/docker.py @@ -95,7 +95,7 @@ def get_image(path, repo_tag=None, config=None): with open(manifest_path) as fp: manifest = json.load(fp) if repo_tag is not None: - manifest = [img for img in manifest if repo_tag in img.get("RepoTags", [])] + manifest = [img for img in manifest if repo_tag in (img.get("RepoTags") or [])] if config is not None: manifest = [img for img in manifest if img["Config"].startswith(config)] if len(manifest) == 0: