Fix TemplateLocation.anyExists logic
Fix broken logic in TemplateLocation.anyExists caused by not using the local `searchPath` variable. See gh-2184 Closes gh-2248
This commit is contained in:
parent
c0d5ad0f0f
commit
0735d6e259
|
@ -65,8 +65,8 @@ public class TemplateLocation {
|
||||||
searchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
|
searchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
|
||||||
+ searchPath.substring(ResourceLoader.CLASSPATH_URL_PREFIX.length());
|
+ searchPath.substring(ResourceLoader.CLASSPATH_URL_PREFIX.length());
|
||||||
}
|
}
|
||||||
if (this.path.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX)) {
|
if (searchPath.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX)) {
|
||||||
Resource[] resources = resolver.getResources(this.path);
|
Resource[] resources = resolver.getResources(searchPath);
|
||||||
for (Resource resource : resources) {
|
for (Resource resource : resources) {
|
||||||
if (resource.exists()) {
|
if (resource.exists()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue