Skip to content

Commit

Permalink
fix: Prevents an NPE.
Browse files Browse the repository at this point in the history
The NPE might have been introduced in e66afe1
  • Loading branch information
gpolitis committed Oct 7, 2021
1 parent 0709bbc commit 7f66d55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/test/java/org/jitsi/meet/test/base/AbstractBaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ public void closeParticipant(P participant)
@AfterClass
public void cleanupClass()
{
this.participants.cleanup();
if (this.participants != null)
{
this.participants.cleanup();
}
}

@BeforeMethod
Expand Down
9 changes: 7 additions & 2 deletions src/test/java/org/jitsi/meet/test/base/ParticipantHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,13 @@ public P get(int index)
*/
public void cleanup()
{
participants.stream().forEach(Participant::closeSafely);
participants.clear();
if (participants != null)
{
participants.stream()
.filter(participant -> participant != null)
.forEach(Participant::closeSafely);
participants.clear();
}
}

/**
Expand Down

0 comments on commit 7f66d55

Please sign in to comment.