Add null check (#9434)

This commit is contained in:
Lauri Tulmin 2023-09-11 19:00:38 +03:00 committed by GitHub
parent 9015f9cd37
commit f7128b0d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ public class SpringBootServiceNameDetector implements ConditionalResourceProvide
@Nullable
private String loadFromClasspath(String filename, Function<InputStream, String> parser) {
try (InputStream in = system.openClasspathResource(filename)) {
return parser.apply(in);
return in != null ? parser.apply(in) : null;
} catch (Exception e) {
return null;
}