From: Marius Gavrilescu Date: Thu, 14 Mar 2013 14:52:20 +0000 (+0200) Subject: Fix NPE in HCER when callback == null and connection errors X-Git-Tag: 0.000_001~53 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=c33b4990b6f2471803b656d06e206b7a74457496;p=fonbot.git Fix NPE in HCER when callback == null and connection errors If the connection error'd, HttpCallExecutableRunnable would call callback.onError even if the callback was null. This is fixed now. --- diff --git a/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java b/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java index 621f0bc..34c5d8d 100644 --- a/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java +++ b/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java @@ -162,7 +162,8 @@ public final class HttpCallExecutableRunnable extends ExecutableRunnable{ conn.disconnect(); } catch (Exception e) { e.printStackTrace(); - callback.onError(toNonNull(context.getString(connection_error))); + if(callback != null) + callback.onError(toNonNull(context.getString(connection_error))); } } }