Error on empty file

Bug #1782978 reported by H@di
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash8
New
Undecided
Unassigned

Bug Description

When `bashate` is run on an empty file, it crashes and throws an uncaught exception:

```console
$ bashate temp.sh
Traceback (most recent call last):
  File "/usr/local/bin/bashate", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/bashate/bashate.py", line 452, in main
    run.check_files(files, opts.verbose)
  File "/usr/local/lib/python3.7/site-packages/bashate/bashate.py", line 415, in check_files
    if not line.endswith('\n'):
UnboundLocalError: local variable 'line' referenced before assignment
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.