From 1502e6a22f1b0cbe9afe2047531c7e96c296cff5 Mon Sep 17 00:00:00 2001 From: Nanda kumar Date: Tue, 16 Jul 2019 15:06:41 +0530 Subject: [PATCH] HDDS-1756. DeleteContainerCommandHandler fails with NPE. Contributed by Nanda kumar(#1095). --- .../hadoop/ozone/container/ozoneimpl/ContainerController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); + } } /**