Skip to content

Commit 44e8213

Browse files
committed
Related to android-async-http#67, avoiding NPE in JsonHttpResponseHandler
1 parent 68840e7 commit 44e8213

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/src/com/loopj/android/http/JsonHttpResponseHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ protected void handleSuccessJsonMessage(int statusCode, Header[] headers, Object
193193
}
194194

195195
protected Object parseResponse(String responseBody) throws JSONException {
196+
if(null == responseBody)
197+
return null;
196198
Object result = null;
197199
//trim the string to prevent start with blank, and test if the string is valid JSON, because the parser don't do this :(. If Json is not valid this will return null
198200
responseBody = responseBody.trim();

0 commit comments

Comments
 (0)