Skip to content

Commit fee69f8

Browse files
authored
fix NPE in NativeEnvironmentRepository (#1809)
Since the fix of this issue : #1771, I experience a NullpointerException at the launch of my service. Indeed, the "location" var is null in my case. Note : since the new Config file processing in Spring Boot 2.4, I'm using the Legacy Processing (spring.config.use-legacy-processing: true), migrating in the new process is way too breaking for my project.
1 parent 63e0a99 commit fee69f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/NativeEnvironmentRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ protected Environment clean(Environment value) {
259259
matches = true;
260260
break;
261261
}
262-
if (location.startsWith("file:")) {
262+
if (location != null && location.startsWith("file:")) {
263263
location = StringUtils
264264
.cleanPath(new File(location.substring("file:".length())).getAbsolutePath()) + "/";
265265
}

0 commit comments

Comments
 (0)