Skip to content

Commit

Permalink
Handle case where CodeQL location doesn't have region (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella authored Apr 30, 2024
1 parent 235e800 commit a678975
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/codemodder/codeql.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def from_sarif(

locations: list[Location] = []
for location in sarif_result["locations"]:
codeql_location = CodeQLLocation.from_sarif(location)
try:
codeql_location = CodeQLLocation.from_sarif(location)
except KeyError:
# TODO: handle this case more gracefully
continue

locations.append(codeql_location)
return cls(rule_id=rule_data["id"], locations=locations)

Expand Down

0 comments on commit a678975

Please sign in to comment.