Skip to content

Commit d8e329f

Browse files
committed
Fix parse empty stomp message
1 parent ec3b1b8 commit d8e329f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/main/java/ua/naiksoftware/stomp/client/StompMessage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package ua.naiksoftware.stomp.client;
22

3+
import android.text.TextUtils;
4+
35
import java.io.StringReader;
46
import java.util.ArrayList;
57
import java.util.List;
@@ -63,6 +65,9 @@ public String compile() {
6365
}
6466

6567
public static StompMessage from(String data) {
68+
if (TextUtils.isEmpty(data)) {
69+
return new StompMessage(StompCommand.UNKNOWN, null, data);
70+
}
6671
Scanner reader = new Scanner(new StringReader(data));
6772
reader.useDelimiter("\\n");
6873
String command = reader.next();

0 commit comments

Comments
 (0)