From 3d00e355245bf2873c7eb64e4883151c993f0004 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Fri, 29 May 2020 16:34:28 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E5=A2=9E=E5=8A=A0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=8A=82=E7=82=B9=E6=8E=A5=E5=8F=A3=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E5=A4=87IP=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dispose/service/impl/DisposeNodeManagerImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dispose/service/impl/DisposeNodeManagerImpl.java b/src/main/java/com/dispose/service/impl/DisposeNodeManagerImpl.java index b30e7ba3..b73d064c 100644 --- a/src/main/java/com/dispose/service/impl/DisposeNodeManagerImpl.java +++ b/src/main/java/com/dispose/service/impl/DisposeNodeManagerImpl.java @@ -136,9 +136,11 @@ public class DisposeNodeManagerImpl implements DisposeNodeManager { public MulReturnType addNewDisposeDevice(DisposeDevice dev) { DisposeEntryManager dp; - if (dev.getType() == null || dev.getIpAddr() == null || !IPAddrType.isIpAddress(dev.getIpAddr())) { + if (dev.getType() == null || dev.getIpAddr() == null + || dev.getIpAddr().length() == 0 + || !IPAddrType.isIpAddress(dev.getIpAddr())) { log.error("Add device error: type {}, ip {}", dev.getType(), dev.getIpAddr()); - return new MulReturnType<>(ErrorCode.ERR_PARAMEXCEPTION, String.valueOf(-1)); + return new MulReturnType<>(ErrorCode.ERR_PARAMS, String.valueOf(-1)); } try {