Skip to content

Commit 4933445

Browse files
author
Tejas
committed
In case of failure say due to network connectivity, this throws class cast exception.
1 parent 23dfc44 commit 4933445

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/com/loopj/android/http/BinaryHttpResponseHandler.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
package com.loopj.android.http;
2020

21-
import java.io.IOException;
22-
import java.util.regex.Pattern;
23-
21+
import android.os.Message;
2422
import org.apache.http.Header;
2523
import org.apache.http.HttpEntity;
2624
import org.apache.http.HttpResponse;
@@ -29,7 +27,8 @@
2927
import org.apache.http.entity.BufferedHttpEntity;
3028
import org.apache.http.util.EntityUtils;
3129

32-
import android.os.Message;
30+
import java.io.IOException;
31+
import java.util.regex.Pattern;
3332

3433
/**
3534
* Used to intercept and handle the responses from requests made using
@@ -147,7 +146,7 @@ protected void handleMessage(Message msg) {
147146
break;
148147
case FAILURE_MESSAGE:
149148
response = (Object[])msg.obj;
150-
handleFailureMessage((Throwable)response[0], (byte[]) response[1]);
149+
handleFailureMessage((Throwable) response[0], response[1] == null ? "" : response[1].toString());
151150
break;
152151
default:
153152
super.handleMessage(msg);

0 commit comments

Comments
 (0)