Skip to content

Commit 647139e

Browse files
committed
Optimize the expression
1 parent 6cf9278 commit 647139e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

webmagic-core/src/main/java/us/codecraft/webmagic/utils/ProxyUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ public static boolean validateProxy(Proxy p) {
3030
logger.warn("FAILRE - CAN not connect! remote: " + p);
3131
return false;
3232
} finally {
33-
if (socket != null) {
34-
try {
33+
try {
3534
socket.close();
3635
} catch (IOException e) {
3736
logger.warn("Error occurred while closing socket of validating proxy", e);
3837
}
39-
}
38+
4039
}
4140

4241
}

0 commit comments

Comments
 (0)