From b37d99cb841eb5f2b67641e9d151d195d14db585 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 3 Jul 2024 10:49:10 +0200 Subject: [PATCH] refactoring due to codacy issue --- .../edu/ie3/simona/agent/grid/GridAgentController.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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,