*/
public static Exception getRecoverableException(RemoteOperationResult result) {
Exception ret = null;
- SSLException e = (SSLException)result.getException();
+ SSLException e = null;
Throwable cause = null;
- if (e != null) {
+ if (result.getException() instanceof SSLException) {
+ e = (SSLException)result.getException();
if (e instanceof SSLPeerUnverifiedException) {
ret = e;
* by setting the certificate as reliable.
*/
public static SslValidatorDialog newInstance(Context context, RemoteOperationResult result, OnSslValidatorListener listener) {
- Exception e = SslAnalyzer.getRecoverableException(result);
- if (e != null) {
+ if (SslAnalyzer.isRecoverable(result)) {
SslValidatorDialog dialog = new SslValidatorDialog(context, listener);
return dialog;
} else {