diff options
| author | doufenghu <[email protected]> | 2021-06-16 12:02:52 +0800 |
|---|---|---|
| committer | doufenghu <[email protected]> | 2021-06-16 12:02:52 +0800 |
| commit | 68c3d7b66ec388fa335560f778348f4178334cb0 (patch) | |
| tree | 59f4679f0866f293d66d584208ac169afb7282c0 | |
| parent | 3b84a80bf9685e18585488cca0491dbd2e169145 (diff) | |
详细地理位置全为空时,将返回空字符v1.0.6.20210615
| -rw-r--r-- | src/main/java/com/zdjizhi/utils/IpLookup.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/com/zdjizhi/utils/IpLookup.java b/src/main/java/com/zdjizhi/utils/IpLookup.java index cb82680..e85d384 100644 --- a/src/main/java/com/zdjizhi/utils/IpLookup.java +++ b/src/main/java/com/zdjizhi/utils/IpLookup.java @@ -606,7 +606,7 @@ public final class IpLookup extends AbstractIpLookup{ class InnerReader implements Strategy { @Override public LocationResponse getResponse(String ip) { - LocationResponse response = new LocationResponse(); + LocationResponse response = null; if(IPUtil.isIP(ip) && IPUtil.internalIp(ip)) { response = new LocationResponse(); response.setCountry(null); @@ -618,11 +618,8 @@ public final class IpLookup extends AbstractIpLookup{ response.setLongitude(null); response.setAreaCode(null); response.setPrivateIP(true); - return response; - } else { - return response; } - + return response; } } |
