File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/com/codebutler/android_websockets Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ public void run() {
94
94
95
95
// Read HTTP response status line.
96
96
StatusLine statusLine = parseStatusLine (readLine (stream ));
97
- if (statusLine .getStatusCode () != HttpStatus .SC_SWITCHING_PROTOCOLS ) {
97
+ if (statusLine == null ) {
98
+ throw new HttpException ("Received no reply from server." );
99
+ } else if (statusLine .getStatusCode () != HttpStatus .SC_SWITCHING_PROTOCOLS ) {
98
100
throw new HttpResponseException (statusLine .getStatusCode (), statusLine .getReasonPhrase ());
99
101
}
100
102
@@ -145,6 +147,9 @@ public void send(byte[] data) {
145
147
}
146
148
147
149
private StatusLine parseStatusLine (String line ) {
150
+ if (TextUtils .isEmpty (line )) {
151
+ return null ;
152
+ }
148
153
return BasicLineParser .parseStatusLine (line , new BasicLineParser ());
149
154
}
150
155
You can’t perform that action at this time.
0 commit comments