From 366ffcd3fef9cd42981e14532f82621623abf8ed Mon Sep 17 00:00:00 2001 From: nkorange Date: Thu, 10 Jan 2019 10:57:20 +0800 Subject: [PATCH] #498 Fix bug --- .../java/com/alibaba/nacos/naming/web/ApiCommands.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java b/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java index 8717126e7..b65f7ae40 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java @@ -1213,8 +1213,9 @@ public class ApiCommands { String dom = WebUtils.required(request, "dom"); String ipListString = WebUtils.required(request, "ipList"); - Loggers.DEBUG_LOG.debug("[REMOVE-IP] full arguments: serviceName:" + dom + ", iplist:" + ipListString); - + if (Loggers.DEBUG_LOG.isDebugEnabled()) { + Loggers.DEBUG_LOG.debug("[REMOVE-IP] full arguments: serviceName:" + dom + ", iplist:" + ipListString); + } List newIPs = new ArrayList<>(); List ipList = new ArrayList<>(); if (Boolean.parseBoolean(WebUtils.optional(request, SwitchEntry.PARAM_JSON, Boolean.FALSE.toString()))) { @@ -1233,6 +1234,11 @@ public class ApiCommands { } } + VirtualClusterDomain domain = (VirtualClusterDomain) domainsManager.getDomain(namespaceId, dom); + if (domain == null) { + throw new IllegalStateException("[" + namespaceId + "] service " + dom + " not found!"); + } + domainsManager.easyRemvIP4Dom(namespaceId, dom, ipObjList); Loggers.EVT_LOG.info("{" + dom + "} {POS} {IP-REMV}" + " dead: "