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."); + } } /**