symbolizersToXML: Do not assume tagcontent has a value

Fixes #297

See https://github.com/mapbox/carto/pull/207
This commit is contained in:
Sandro Santilli 2013-09-11 12:23:57 +02:00
parent a6439e3f92
commit c89ed510ff

View File

@ -129,7 +129,7 @@ tree.Definition.prototype.symbolizersToXML = function(env, symbolizers, zoom) {
if (selfclosing) {
xml += '/>\n';
} else {
if (tagcontent.indexOf('<Format') != -1) {
if (tagcontent && tagcontent.indexOf('<') != -1) {
xml += '>' + tagcontent + '</' + name + '>\n';
} else {
xml += '><![CDATA[' + tagcontent + ']]></' + name + '>\n';