]> iEval git - fonbot.git/commitdiff
Fix NPE in HCER when callback == null and connection errors
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 14 Mar 2013 14:52:20 +0000 (16:52 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 14 Mar 2013 14:52:20 +0000 (16:52 +0200)
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

index 621f0bc5187fadfbc404926a19b052aeaf6dbace..34c5d8d8260265be43ee1e6edee0460d1accf95b 100644 (file)
@@ -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)));
                }
        }
 }
This page took 0.030678 seconds and 4 git commands to generate.