Skip to content

Commit a678975

Browse files
authored
Handle case where CodeQL location doesn't have region (#532)
1 parent 235e800 commit a678975

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/codemodder/codeql.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def from_sarif(
4545

4646
locations: list[Location] = []
4747
for location in sarif_result["locations"]:
48-
codeql_location = CodeQLLocation.from_sarif(location)
48+
try:
49+
codeql_location = CodeQLLocation.from_sarif(location)
50+
except KeyError:
51+
# TODO: handle this case more gracefully
52+
continue
53+
4954
locations.append(codeql_location)
5055
return cls(rule_id=rule_data["id"], locations=locations)
5156

0 commit comments

Comments
 (0)