diff --git a/src/com/codebutler/android_websockets/SocketIOClient.java b/src/com/codebutler/android_websockets/SocketIOClient.java index af461fb..615f70a 100644 --- a/src/com/codebutler/android_websockets/SocketIOClient.java +++ b/src/com/codebutler/android_websockets/SocketIOClient.java @@ -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