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,