Skip to content

Commit

Permalink
fix: null safety in getDockerPlatform improved (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKandut authored Nov 18, 2024
1 parent 77e0427 commit bc425f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DockerExecutor {

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

String getContainerPlatform(Map<String, Object> inspection) {
Expand Down

0 comments on commit bc425f9

Please sign in to comment.