From coverity: client.getInetAddress() may return null

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2258 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2014-03-17 22:58:13 +00:00
parent 58f84bcd12
commit 3a56ffbe61
1 changed files with 2 additions and 1 deletions

View File

@ -812,7 +812,8 @@ public class LdapConnection extends AbstractConnection {
protected String getCurrentHostName() throws UnknownHostException { protected String getCurrentHostName() throws UnknownHostException {
if (currentHostName == null) { if (currentHostName == null) {
if (client.getInetAddress().isLoopbackAddress()) { InetAddress clientInetAddress = client.getInetAddress();
if (clientInetAddress != null && clientInetAddress.isLoopbackAddress()) {
// local address, probably using localhost in iCal URL // local address, probably using localhost in iCal URL
currentHostName = "localhost"; currentHostName = "localhost";
} else { } else {