Skip to content

Commit

Permalink
fix(transport): Avoid throwing IndexOutOfBoundsException when Link he…
Browse files Browse the repository at this point in the history
…ader is missing content
  • Loading branch information
andacata committed Mar 22, 2024
1 parent 6aaf27c commit 941c746
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ inline fun <reified T> HttpResponse.parsePaginatedBody(offset: Int): OcpiRespons
limit = getHeader(Header.X_LIMIT)?.toInt()
?: throw OcpiToolkitMissingRequiredResponseHeaderException(Header.X_LIMIT),
offset = offset,
nextPageUrl = getHeader(Header.LINK)?.split("<")?.get(1)?.split(">")?.first()
nextPageUrl = getHeader(Header.LINK)?.split("<")?.elementAtOrNull(1)?.split(">")?.first()
),
status_code = parsedBody.status_code,
status_message = parsedBody.status_message,
Expand Down

0 comments on commit 941c746

Please sign in to comment.