You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by "leonardcser (via GitHub)" <gi...@apache.org> on 2023/04/28 08:29:36 UTC
[GitHub] [incubator-baremaps] leonardcser opened a new pull request, #638: Catch null pointer exception server resources
leonardcser opened a new pull request, #638:
URL: https://github.com/apache/incubator-baremaps/pull/638
## Bug
When making a `GET` request to an url that does not exist, we get a 500 error with a NullPointerException on the server.
This is because `getClass().getClassLoader().getResourceAsStream(path)` returns null if the path is not found which then throws the NullPointerException here:
```java
var bytes = inputStream.readAllBytes();
```
## Solution
Add a catch for a NullPointerException, and return a 404.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-baremaps] bchapuis merged pull request #638: Catch null pointer exception server resources
Posted by "bchapuis (via GitHub)" <gi...@apache.org>.
bchapuis merged PR #638:
URL: https://github.com/apache/incubator-baremaps/pull/638
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@baremaps.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org