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() {
9494
9595 // Read HTTP response status line.
9696 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 ) {
98100 throw new HttpResponseException (statusLine .getStatusCode (), statusLine .getReasonPhrase ());
99101 }
100102
@@ -145,6 +147,9 @@ public void send(byte[] data) {
145147 }
146148
147149 private StatusLine parseStatusLine (String line ) {
150+ if (TextUtils .isEmpty (line )) {
151+ return null ;
152+ }
148153 return BasicLineParser .parseStatusLine (line , new BasicLineParser ());
149154 }
150155
You can’t perform that action at this time.
0 commit comments