compiledb icon indicating copy to clipboard operation
compiledb copied to clipboard

Fix potential KeyError in merge_compdb()

Open i-ky opened this issue 2 years ago • 0 comments

At the point where entry['directory'] is used, 'directory' is definitely not in entry as checked in if two lines above https://github.com/nickdiego/compiledb/blob/b615d526019c7b809882090ea7eaff85423f2b13/compiledb/init.py#L88 On the other hand, 'file' is guaranteed to be in entry, because gen_key(c) is called only if 'file' in c https://github.com/nickdiego/compiledb/blob/b615d526019c7b809882090ea7eaff85423f2b13/compiledb/init.py#L95-L96 This looks like a "typo".

i-ky avatar Mar 07 '22 13:03 i-ky