From f802c1d889fe6e688509c33bf29d2a0de120e11d Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sun, 12 Jun 2011 21:33:36 -0700 Subject: [PATCH] Prevent broken JSON when http://jsonip.appspot.com/ is over quote or broken. --- web/js/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/chat.js b/web/js/chat.js index 3031c7ff..17b1031f 100644 --- a/web/js/chat.js +++ b/web/js/chat.js @@ -21,7 +21,7 @@ componentconstructors['chat'] = function(dynmap, configuration) { if (dynmap.options.allowwebchat) { // Accepts 'sendchat'-events to send chat messages to the server. $(dynmap).bind('sendchat', function(event, message) { - var data = '{"name":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}'; + var data = '{"name":'+JSON.stringify(ip?ip:"")+',"message":'+JSON.stringify(message)+'}'; $.ajax({ type: 'POST', url: config.url.sendmessage,