From 3a56ffbe61d7fbe77fb5e8b728920e5c7604d691 Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 17 Mar 2014 22:58:13 +0000 Subject: [PATCH] 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 --- src/java/davmail/ldap/LdapConnection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/ldap/LdapConnection.java b/src/java/davmail/ldap/LdapConnection.java index 418866b8..334b1384 100644 --- a/src/java/davmail/ldap/LdapConnection.java +++ b/src/java/davmail/ldap/LdapConnection.java @@ -812,7 +812,8 @@ public class LdapConnection extends AbstractConnection { protected String getCurrentHostName() throws UnknownHostException { if (currentHostName == null) { - if (client.getInetAddress().isLoopbackAddress()) { + InetAddress clientInetAddress = client.getInetAddress(); + if (clientInetAddress != null && clientInetAddress.isLoopbackAddress()) { // local address, probably using localhost in iCal URL currentHostName = "localhost"; } else {