Merge pull request #209 from mikeprimm/master
Prevent bad JSON when http://jsonip.appspot.com/ is broken or overquota
This commit is contained in:
commit
8ce2d0ea55
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ componentconstructors['chat'] = function(dynmap, configuration) {
|
||||||
if (dynmap.options.allowwebchat) {
|
if (dynmap.options.allowwebchat) {
|
||||||
// Accepts 'sendchat'-events to send chat messages to the server.
|
// Accepts 'sendchat'-events to send chat messages to the server.
|
||||||
$(dynmap).bind('sendchat', function(event, message) {
|
$(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({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: config.url.sendmessage,
|
url: config.url.sendmessage,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue