diff --git a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala index d3c02e20db..aa97f858d8 100644 --- a/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala +++ b/src/main/scala/edu/ie3/simona/agent/grid/GridAgentController.scala @@ -201,9 +201,10 @@ class GridAgentController( .map { participant => val node = participant.getNode - val controllingEm: Option[UUID] = - participant.getControllingEm.toScala.map(_.getUuid) - val emActorRef = controllingEm.flatMap(allEms.get) + val controllingEm = + participant.getControllingEm.toScala.flatMap(em => Option(em.getUuid)) + val emActorRef = controllingEm.flatMap(uuid => allEms.get(uuid)) + val actorRef = buildParticipantActor( participantsConfig.requestVoltageDeviationThreshold, participantConfigUtil,