Fix EventFight activeFights query and add null check for spectatePort in CookieEvents

This commit is contained in:
2025-05-29 15:05:01 +02:00
parent 40eeb4993f
commit 7a9740c4c4
2 changed files with 2 additions and 1 deletions
@@ -37,6 +37,7 @@ public class CookieEvents extends BasicListener {
EventFight.getActiveFights().stream()
.filter(fight -> fight.getTeamRed() == user.getTeam() || fight.getTeamBlue() == user.getTeam())
.filter(fight -> fight.getSpectatePort() != null)
.filter(fight -> fight.getSpectatePort() != 0)
.findFirst()
.flatMap(fight -> VelocityCore.getProxy().getServer(EventStarter.getSpectatePorts().get(fight.getSpectatePort())))