mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-01 06:33:38 +01:00
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
@ -136,7 +136,9 @@ public class JsonFileClientUpdateComponent extends ClientUpdateComponent {
|
|||||||
Iterator<?> iter = jsonMsgs.iterator();
|
Iterator<?> iter = jsonMsgs.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
JSONObject o = (JSONObject) iter.next();
|
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 name = String.valueOf(o.get("name"));
|
||||||
String message = String.valueOf(o.get("message"));
|
String message = String.valueOf(o.get("message"));
|
||||||
webChat(name, message);
|
webChat(name, message);
|
||||||
|
Loading…
Reference in New Issue
Block a user