Skip to content

Commit

Permalink
This API should actually not return null
Browse files Browse the repository at this point in the history
  • Loading branch information
rmaucher committed Jun 29, 2023
1 parent 430ae2e commit 341ee31
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions java/org/apache/catalina/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -1989,18 +1989,16 @@ default Resource findConfigFileResource(String name) throws IOException {
if (name.startsWith(WEBAPP_PROTOCOL)) {
String path = name.substring(WEBAPP_PROTOCOL.length());
WebResource resource = getResources().getResource(path);
if (resource.canRead()) {
if (resource.canRead() && resource.isFile()) {
InputStream stream = resource.getInputStream();
try {
return new Resource(stream, resource.getURL().toURI());
} catch (URISyntaxException e) {
stream.close();
}
}
return null;
} else {
return ConfigFileLoader.getSource().getResource(name);
}
return ConfigFileLoader.getSource().getResource(name);
}

}

1 comment on commit 341ee31

@michael-o
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still does not address all behavioral aspects mentioned in 3d41f33#r120029765

Please sign in to comment.