diff options
author | Joey Grover <joeygrover@gmail.com> | 2017-02-08 14:43:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 14:43:43 -0500 |
commit | bd0b9549a7766e6682c9e0956bee1012f87bbfc8 (patch) | |
tree | d1b8aa78c14a824022fd5904c3b89542dbc7953b | |
parent | 2744cba6648be61b6abdd15f870f9505b7ce5be4 (diff) | |
parent | 6434edc23273cf5ffa2b2885e536c7b92d3c4052 (diff) | |
download | sdl_android-bd0b9549a7766e6682c9e0956bee1012f87bbfc8.tar.gz |
Merge pull request #413 from smartdevicelink/bugfix/issue_390
Catch NPE in HttpRequestTask when it can't reach the server
-rw-r--r-- | sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java index 3d26b2994..5e8bba95c 100644 --- a/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java +++ b/sdl_android_lib/src/com/smartdevicelink/util/HttpRequestTask.java @@ -137,6 +137,9 @@ public class HttpRequestTask extends AsyncTask<String, String, String> { } catch (IOException e) { e.printStackTrace(); + } catch (NullPointerException e){ // Only to catch error in urlConnection.getOutputStream() - when servers are down + e.printStackTrace(); + urlConnection = null; } finally { if (urlConnection != null) { |