Add null check (#9434)
This commit is contained in:
parent
9015f9cd37
commit
f7128b0d59
|
@ -259,7 +259,7 @@ public class SpringBootServiceNameDetector implements ConditionalResourceProvide
|
||||||
@Nullable
|
@Nullable
|
||||||
private String loadFromClasspath(String filename, Function<InputStream, String> parser) {
|
private String loadFromClasspath(String filename, Function<InputStream, String> parser) {
|
||||||
try (InputStream in = system.openClasspathResource(filename)) {
|
try (InputStream in = system.openClasspathResource(filename)) {
|
||||||
return parser.apply(in);
|
return in != null ? parser.apply(in) : null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue