Skip to content

Commit b463c74

Browse files
authored
[java] fix bug in setting build name (#327)
1 parent 34ea797 commit b463c74

File tree

1 file changed

+10
-10
lines changed
  • java/main/src/main/java/com/saucelabs/saucebindings

1 file changed

+10
-10
lines changed

java/main/src/main/java/com/saucelabs/saucebindings/CITools.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ public abstract class CITools {
3636
"Travis", ImmutableList.of("TRAVIS_JOB_NAME", "TRAVIS_JOB_NUMBER"));
3737

3838
private static void storeBuildInfo() {
39-
if (buildInfoStored) {
40-
return;
41-
}
42-
43-
for (Map.Entry<String, String> tool : KNOWN_TOOLS.entrySet()) {
44-
if (SystemManager.get(tool.getValue()) != null) {
45-
buildName = BUILD_VALUES.get(tool.getKey()).get(0);
46-
buildNumber = BUILD_VALUES.get(tool.getKey()).get(1);
47-
buildInfoStored = true;
48-
break;
39+
if (!buildInfoStored) {
40+
for (Map.Entry<String, String> tool : KNOWN_TOOLS.entrySet()) {
41+
if (SystemManager.get(tool.getValue()) != null) {
42+
buildName = SystemManager.get(BUILD_VALUES.get(tool.getKey()).get(0));
43+
buildNumber = SystemManager.get(BUILD_VALUES.get(tool.getKey()).get(1));
44+
if (buildName != null && buildNumber != null) {
45+
buildInfoStored = true;
46+
break;
47+
}
48+
}
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)