mapbox / carto

fast CSS-like map stylesheets
https://cartocss.readthedocs.io/
Apache License 2.0
652 stars 129 forks source link

TypeError: Cannot read property 'toString' of null #488

Closed stremovskyy closed 6 years ago

stremovskyy commented 6 years ago

Using OSM Bright theme

carto project.mml > OSMBright.xml                                                                      
TypeError: Cannot read property 'toString' of null
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:172:24)
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:137:36)
    at /usr/local/lib/node_modules/carto/lib/carto/util.js:159:33
    at Array.map (native)
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:158:29)
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:137:36)
    at /usr/local/lib/node_modules/carto/lib/carto/util.js:159:33
    at Array.map (native)
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:158:29)
    at Util.jsonToXML (/usr/local/lib/node_modules/carto/lib/carto/util.js:137:36)
nebulon42 commented 6 years ago

I can confirm this. The obvious fix is not to transform the object into a string if it is null. I still have to check if this is just a symptom of something else that goes wrong. Thanks for reporting.

nebulon42 commented 6 years ago

The fix is now in master. @Karmadon could you try if master produces a functioning XML for you?

wkunker commented 6 years ago

@nebulon42 That fixed it for me.

stremovskyy commented 6 years ago

@nebulon42 fixed THX!

nebulon42 commented 6 years ago

Great, so I'll release 1.0.1.