Skip to content

Commit

Permalink
Fix get_location_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Mar 29, 2023
1 parent 0cec1d0 commit 2f328e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion loki/lint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def get_location_hash(location):
The hash as a string or, if no hash can be created for :data:`location`,
`None` is returned.
"""
if getattr(location, 'source') and location.source.string:
if getattr(location, 'source', None) and location.source.string:
first_line = location.source.string[:location.source.string.find('\n')]
line_hash = str(md5(first_line.encode()).hexdigest())
return line_hash
Expand Down

0 comments on commit 2f328e5

Please sign in to comment.