Skip to content

Commit 39209a5

Browse files
committed
Fixed bug in test set up.
1 parent 2aba1c6 commit 39209a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/java/org/gitlab4j/api/TestProjectApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ private static void deleteAllTransientTestData() {
140140
if (TEST_GROUP != null && TEST_PROJECT_NAME != null) {
141141
try {
142142
List<Group> groups = gitLabApi.getGroupApi().getGroups(TEST_GROUP);
143-
gitLabApi.getProjectApi().unshareProject(testProject, groups.get(0).getId());
143+
if (groups != null && groups.size() > 0) {
144+
gitLabApi.getProjectApi().unshareProject(testProject, groups.get(0).getId());
145+
}
144146

145147
List<Variable> variables = gitLabApi.getProjectApi().getVariables(testProject);
146148
if (variables != null) {

0 commit comments

Comments
 (0)