symbolizersToXML: Do not assume tagcontent has a value

Fixes #297

Includes testcase
This commit is contained in:
Sandro Santilli 2013-09-11 12:23:57 +02:00
parent 2ead8dafa2
commit 236d64ec14
3 changed files with 6 additions and 1 deletions

View File

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

View File

@ -0,0 +1,4 @@
#t {
text-name: invalid;
text-face-name: "Dejagnu";
}

View File

@ -0,0 +1 @@
issue297.mss:2:2 Invalid value for text-name, the type expression is expected. invalid (of type keyword) was given.