diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java index f643c1f11b4..523e63ff91f 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerController.java @@ -137,7 +137,9 @@ public class ContainerController { public void deleteContainer(final long containerId, boolean force) throws IOException { final Container container = containerSet.getContainer(containerId); - getHandler(container).deleteContainer(container, force); + if (container != null) { + getHandler(container).deleteContainer(container, force); + } } /**