Fix link parsing bug that causes crash

This commit is contained in:
Maurice Parker 2019-05-31 07:22:28 -05:00
parent beacad1aeb
commit d602f894f6
1 changed files with 3 additions and 2 deletions

View File

@ -532,10 +532,11 @@ extension FeedbinAPICaller {
}
if let lowerBound = link.range(of: "page=")?.upperBound {
if let upperBound = link.range(of: "&")?.lowerBound {
let partialLink = link[lowerBound..<link.endIndex]
if let upperBound = partialLink.range(of: "&")?.lowerBound {
return Int(link[lowerBound..<upperBound])
}
if let upperBound = link.range(of: ">")?.lowerBound {
if let upperBound = partialLink.range(of: ">")?.lowerBound {
return Int(link[lowerBound..<upperBound])
}
}