diff options
author | Joey Grover <joeygrover@gmail.com> | 2016-11-03 09:48:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-03 09:48:27 -0400 |
commit | 952680d77a582bf265195c5dd0ef3f262e0b64c7 (patch) | |
tree | f3a89ddbb15fa0beea97d42bcee9cea7363786a3 | |
parent | a0ac7b22634788cf0d40b275324231559ac86d0c (diff) | |
parent | 364b4aaa374d0c3e8ad78cbd1f4be33eee789e82 (diff) | |
download | sdl_android-952680d77a582bf265195c5dd0ef3f262e0b64c7.tar.gz |
Merge pull request #356 from smartdevicelink/bugfix/issue_355
Prevent incorrect error callbacks in HttpRequestTask
-rw-r--r-- | sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java index f5f56ece4..3d26b2994 100644 --- a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java +++ b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java @@ -69,6 +69,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { Log.e(TAG, "Can't process request, param error"); if(cb!=null){ cb.httpFailure(-1); + cb = null; } return "Error"; } @@ -98,6 +99,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { // Nothing to do. if(cb!=null){ cb.httpCallComplete(null); + cb = null; } return null; } @@ -110,6 +112,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { // Stream was empty. No point in parsing. if(cb!=null){ cb.httpCallComplete(null); + cb = null; } return null; } @@ -119,17 +122,19 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { //send to post execute if(cb!=null){ cb.httpCallComplete(response); + cb = null; } return response; }else{ if(cb!=null){ cb.httpFailure(responseCode); + cb = null; } Log.e(TAG, "Failed to download file - " + responseCode); return null; } - + } catch (IOException e) { e.printStackTrace(); } |