Skip to content

Commit

Permalink
Merge pull request koush#4 from bkase/fix_noargs
Browse files Browse the repository at this point in the history
Fixed crash on a no-argument message
  • Loading branch information
koush committed Jan 3, 2013
2 parents e088b9e + 6adfa2a commit 7de2163
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/com/codebutler/android_websockets/SocketIOClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ public void onMessage(String message) {
final String dataString = parts[3];
JSONObject data = new JSONObject(dataString);
String event = data.getString("name");
JSONArray args = data.getJSONArray("args");
JSONArray args;
try {
args = data.getJSONArray("args");
} catch (JSONException e) {
args = new JSONArray();
}
if (!"".equals(messageId)) {
mSendHandler.post(new Runnable() {
@Override
Expand Down

0 comments on commit 7de2163

Please sign in to comment.