Skip to content

Commit

Permalink
Merge pull request #133 from akkrat/fix_force_unwrap_131
Browse files Browse the repository at this point in the history
Skip invalid locations
  • Loading branch information
ecamacho authored Mar 30, 2021
2 parents d435970 + 0cb356d commit a7bda19
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ extension SwiftCompilerTimeOptionParser {
return nil
}

guard fileAndLocationParts.count == 3 else {
guard
fileAndLocationParts.count == 3,
let line = Int(fileAndLocationParts[1]),
let column = Int(fileAndLocationParts[2])
else {
return nil
}

let file = prefixWithFileURL(fileName: rawFile)
let line = Int(fileAndLocationParts[1])!
let column = Int(fileAndLocationParts[2])!

return (file, line, column)
}
Expand Down

0 comments on commit a7bda19

Please sign in to comment.