hotosm / osm-export-tool

Web service to download customised OSM data in various file formats
http://export.hotosm.org/
BSD 3-Clause "New" or "Revised" License
145 stars 46 forks source link

Handle null e.g. in the case of manual bbox #528

Closed byronigoe closed 8 months ago

byronigoe commented 8 months ago

The interface used to support entering your own bounding box as a comma-separated list of 4 numbers. This is now broken because adminName2 will be null.

Uncaught TypeError: Cannot read properties of undefined (reading 'startsWith')
    at A.handleSearch (ExportAOI.js:140:27)
    at A.handleChange (SearchAOIToolbar.js:53:18)
    at Object.<anonymous> (SearchAOIToolbar.js:29:12)

This fix uses optional chaining to avoid this error.