Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
null check for response listener
Browse files Browse the repository at this point in the history
  • Loading branch information
mcxiaoke committed Sep 8, 2015
1 parent c111d14 commit 798ce09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/android/volley/toolbox/JsonRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ protected void onFinish() {

@Override
protected void deliverResponse(T response) {
mListener.onResponse(response);
if (mListener != null) {
mListener.onResponse(response);
}
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/android/volley/toolbox/StringRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ protected void onFinish() {

@Override
protected void deliverResponse(String response) {
mListener.onResponse(response);
if (mListener != null) {
mListener.onResponse(response);
}
}

@Override
Expand Down

0 comments on commit 798ce09

Please sign in to comment.