fix trivial NPE (fixes #2142)
This commit is contained in:
parent
7a9673fe47
commit
010e612f85
|
@ -376,7 +376,8 @@ public class HkpKeyserverClient implements KeyserverClient {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(Constants.TAG, "IOException at HkpKeyserver", e);
|
Log.e(Constants.TAG, "IOException at HkpKeyserver", e);
|
||||||
String proxyInfo = proxy.getProxy() == Proxy.NO_PROXY ? "" : " Using proxy " + proxy.getProxy();
|
String proxyInfo = proxy.getProxy() == Proxy.NO_PROXY ? "" : " Using proxy " + proxy.getProxy();
|
||||||
String causeName = e.getCause().getClass().getSimpleName();
|
Throwable cause = e.getCause();
|
||||||
|
String causeName = cause != null ? cause.getClass().getSimpleName() : "generic";
|
||||||
throw new KeyserverClient.QueryFailedException(String.format(
|
throw new KeyserverClient.QueryFailedException(String.format(
|
||||||
"Network error (%s) for '%s'. Check your Internet connection! %s",
|
"Network error (%s) for '%s'. Check your Internet connection! %s",
|
||||||
causeName, hkpKeyserver.getUrl(), proxyInfo));
|
causeName, hkpKeyserver.getUrl(), proxyInfo));
|
||||||
|
|
Loading…
Reference in a new issue