Merge pull request #177 from mikeprimm/master
Avoid exception in JSON handling for web chat messages without timestanp
This commit is contained in:
commit
74fb60718d
1 changed files with 3 additions and 1 deletions
|
|
@ -136,7 +136,9 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||
Iterator<?> iter = jsonMsgs.iterator();
|
||||
while (iter.hasNext()) {
|
||||
JSONObject o = (JSONObject) iter.next();
|
||||
if (Long.parseLong(String.valueOf(o.get("timestamp"))) >= (lastTimestamp)) {
|
||||
String ts = String.valueOf(o.get("timestamp"));
|
||||
if(ts.equals("null")) ts = "0";
|
||||
if (Long.parseLong(ts) >= (lastTimestamp)) {
|
||||
String name = String.valueOf(o.get("name"));
|
||||
String message = String.valueOf(o.get("message"));
|
||||
webChat(name, message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue