Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException is thrown when pagination headers are missing #87

Closed
andacata opened this issue Mar 21, 2024 · 1 comment · Fixed by #88
Closed

NullPointerException is thrown when pagination headers are missing #87

andacata opened this issue Mar 21, 2024 · 1 comment · Fixed by #88
Labels
bug Something isn't working module: all

Comments

@andacata
Copy link
Contributor

When the required headers X-Total-Count or X-Limit are not returned from the other partner, an uncontrolled NullPointerExeption is thrown.

data = parsedBody.data?.toSearchResult(
totalCount = getHeader(Header.X_TOTAL_COUNT)!!.toInt(),
limit = getHeader(Header.X_LIMIT)!!.toInt(),
offset = offset,
nextPageUrl = getHeader(Header.LINK)?.split("<")?.get(1)?.split(">")?.first()
),

@lilgallon
Copy link
Member

It is a more general issue, see #17

We should do that everywhere it's needed. But it is a good start

@lilgallon lilgallon added bug Something isn't working module: all labels Mar 21, 2024
lilgallon added a commit that referenced this issue Mar 21, 2024
…xception_on_missing_headers

fix(transport) #87: Throw explicit exception when a required header is missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module: all
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants