From 223f67150afbd4b32cbde6ff512ff337e5e869f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=B6der?= Date: Fri, 5 Jan 2024 13:53:31 +0100 Subject: [PATCH] Removed an assertion that made the closing of an experiment fail although it wasn't necessary. --- .../java/org/hobbit/controller/PlatformController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform-controller/src/main/java/org/hobbit/controller/PlatformController.java b/platform-controller/src/main/java/org/hobbit/controller/PlatformController.java index ea1ffde6..419dbb1b 100644 --- a/platform-controller/src/main/java/org/hobbit/controller/PlatformController.java +++ b/platform-controller/src/main/java/org/hobbit/controller/PlatformController.java @@ -340,9 +340,12 @@ public void setExpRabbitMQConnector(RabbitMQConnector rabbitMQConnector) { */ public void closeExpRabbitMQConnector() { LOGGER.info("Closing experiment's RabbitMQ connector for the command queue: {}", rabbitMQConnector); - assert rabbitMQConnector != null : "RabbitMQ connector shouldn't be null"; - IOUtils.closeQuietly(rabbitMQConnector); - rabbitMQConnector = null; + if(rabbitMQConnector != null) { + IOUtils.closeQuietly(rabbitMQConnector); + rabbitMQConnector = null; + } else { + LOGGER.warn("Got a request to close the RabbitMQ connector but it was already null."); + } } /**