Skip to content

Commit

Permalink
Don't crash if response body is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
geecko86 authored Feb 18, 2017
1 parent 1e4341c commit bc8e9ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SpotifyApi/src/main/java/com/drivemode/spotify/SpotifyApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ public void onCallback(Uri data, final AuthenticationListener listener) {
call.enqueue(new Callback<AccessToken>() {
@Override
public void onResponse(Call<AccessToken> call, retrofit2.Response<AccessToken> response) {
if (response.isSuccessful())
if (response.isSuccessful()) {
Log.v(TAG, "success retrieving access token: " + response.body());
else
mTokenStore.store(response.body());
listener.onReady();
} else
Log.v(TAG, "failed");
mTokenStore.store(response.body());
listener.onReady();
}

@Override
Expand Down Expand Up @@ -241,4 +241,4 @@ public interface AuthenticationListener {
public void onReady();
public void onError();
}
}
}

0 comments on commit bc8e9ee

Please sign in to comment.