Skip to content

Commit 935d759

Browse files
committed
Fix 'Protect against empty OS string in Docker Image' logic
See gh-45152
1 parent c071f56 commit 935d759

File tree

1 file changed

+2
-2
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type

1 file changed

+2
-2
lines changed

Diff for: spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Image.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -91,7 +91,7 @@ public List<LayerId> getLayers() {
9191
* @return the image OS
9292
*/
9393
public String getOs() {
94-
return (!StringUtils.hasText(this.os)) ? this.os : "linux";
94+
return (!StringUtils.hasText(this.os)) ? "linux" : this.os;
9595
}
9696

9797
/**

0 commit comments

Comments
 (0)