Skip to content

Commit

Permalink
Avoid exception with empty galaxy files (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 7, 2021
1 parent 262268f commit f985799
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ansiblelint/_prerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ def _perform_mockings() -> None:
if not os.path.exists("galaxy.yml"):
return
yaml = yaml_from_file("galaxy.yml")
if not yaml:
# ignore empty galaxy.yml file
return
namespace = yaml.get('namespace', None)
collection = yaml.get('name', None)
if not namespace or not collection:
Expand Down

0 comments on commit f985799

Please sign in to comment.