Skip to content

Commit bc425f9

Browse files
authored
fix: null safety in getDockerPlatform improved (#466)
1 parent 77e0427 commit bc425f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/groovy/com/avast/gradle/dockercompose/DockerExecutor.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DockerExecutor {
4848

4949
String getDockerPlatform() {
5050
String osType = getDockerInfo().collect { it.trim() }.find { it.startsWith('OSType:') }
51-
osType.empty ? System.getProperty("os.name") : osType.substring('OSType:'.length()).trim()
51+
osType == null || osType.empty ? System.getProperty("os.name") : osType.substring('OSType:'.length()).trim()
5252
}
5353

5454
String getContainerPlatform(Map<String, Object> inspection) {

0 commit comments

Comments
 (0)