From c33b4990b6f2471803b656d06e206b7a74457496 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 14 Mar 2013 16:52:20 +0200 Subject: [PATCH 1/1] 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. --- src/ro/ieval/fonbot/HttpCallExecutableRunnable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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))); } } } -- 2.39.2