Skip to content

Commit

Permalink
Handle null compile commands entries
Browse files Browse the repository at this point in the history
Signed-off-by: Bartłomiej Chmiel <[email protected]>
  • Loading branch information
b-chmiel committed Nov 20, 2024
1 parent c4eeee5 commit c8b2bf2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nodist/clang_check_attributes
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,11 @@ def main():
cxxflags = []
if compdb:
entry = compdb.getCompileCommands(filename)
entry_list = list(entry)
if entry is None:
print(f"%Error: reading compile commands failed: {filename}", file=sys.stderr)
entry_list = []
else:
entry_list = list(entry)
# Compilation database can contain multiple entries for single file,
# e.g. when it has been updated by appending new entries.
# Use last entry for the file, if it exists, as it is the newest one.
Expand Down

0 comments on commit c8b2bf2

Please sign in to comment.