Prevent Gpsies-style export from throwing for undefined symbols
While abrensch/brouter@82fecf9 fixed the export already by avoiding the problematic `OFFR` voice hint, we would still throw in case we encountered an `undefined` symbol entry: > Uncaught TypeError: Cannot read properties of undefined (reading > 'toLowerCase') This can be prevented by not calling `toLowerCase()` on `undefined` objects. Fixes #751 Test Plan: - Change `VoiceHints.commands` to contain `undefined` entries for a particular voice hint. - Create a route with that voice hint. - Test that exporting for each `turnInstructionMode` does not throw.
This commit is contained in:
parent
96016b7fd0
commit
8809fa94cf
1 changed files with 1 additions and 1 deletions
|
|
@ -179,7 +179,7 @@
|
|||
|
||||
class GpsiesVoiceHints extends WaypointVoiceHints {
|
||||
_getWpt(hint, cmd, coord) {
|
||||
return { name: cmd.message, sym: cmd.symbol.toLowerCase(), type: cmd.symbol };
|
||||
return { name: cmd.message, sym: cmd.symbol?.toLowerCase(), type: cmd.symbol };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue