From 935d7597542bd0da8ece940cc2f8d6bb05fd27f3 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 10 Apr 2025 16:29:31 -0700 Subject: [PATCH] Fix 'Protect against empty OS string in Docker `Image`' logic See gh-45152 --- .../boot/buildpack/platform/docker/type/Image.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Image.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Image.java index ad4176a6127..4002374d0d3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Image.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Image.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ public class Image extends MappedObject { * @return the image OS */ public String getOs() { - return (!StringUtils.hasText(this.os)) ? this.os : "linux"; + return (!StringUtils.hasText(this.os)) ? "linux" : this.os; } /**