Skip to content

Commit 3acf025

Browse files
committed
fix(ci): handle null user.home defensively in BomContentTest
1 parent 8fd4ac0 commit 3acf025

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

java-cloud-bom/tests/src/test/java/com/google/cloud/BomContentTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ private static String buildMavenCentralUrl(Artifact artifact) {
154154
private static boolean existsLocally(Artifact artifact) {
155155
String localRepository = System.getProperty("maven.repo.local");
156156
if (localRepository == null) {
157+
String userHome = System.getProperty("user.home");
158+
if (userHome == null) {
159+
return false;
160+
}
157161
// Standard default location for Maven local repository.
158-
localRepository = System.getProperty("user.home") + "/.m2/repository";
162+
localRepository = userHome + "/.m2/repository";
159163
}
160164
Path localPath =
161165
Paths.get(

0 commit comments

Comments
 (0)