ABAPlan / abaplan-core

Core ABAPlan project
MIT License
4 stars 2 forks source link

Search for transport stop issue console error if no point pressed before #132

Open Ettapp opened 6 years ago

Ettapp commented 6 years ago

Location

In the touchpad-voice.

Description

When using the Itinerary stops command (vocal or hotkey), if there where no previous point pressed, an error is issued in the console but no vocal (or even visual) feedback of the error are provided.

Error message

ERROR TypeError: Cannot read property 'y' of undefined
    at OpendataCHProvider.getStationsNearby (webpack-internal:///./src/app/core/opendataProvider.ts:10)
    at TransportService.stationsNearby (webpack-internal:///./src/app/core/transport.service.ts:19)
    at TouchpadComponent.searchStation (webpack-internal:///./src/app/touchpad/touchpad.component.ts:218)
    at HotkeysService.callback (webpack-internal:///./src/app/touchpad/touchpad.component.ts:53)
    at eval (webpack-internal:///./node_modules/angular2-hotkeys/src/hotkeys.service.js:75)
    at _fireCallback (webpack-internal:///./node_modules/mousetrap/mousetrap.js:616)
    at Mousetrap.self._handleKey (webpack-internal:///./node_modules/mousetrap/mousetrap.js:677)
    at Mousetrap.handleKey (webpack-internal:///./node_modules/mousetrap/mousetrap.js:994)
    at HTMLDocument._handleKeyEvent (webpack-internal:///./node_modules/mousetrap/mousetrap.js:737)
    at ZoneDelegate.invokeTask (webpack-internal:///./node_modules/zone.js/dist/zone.js:420)

Reproduction procedure

  1. Open a saved map in the touchpad-voice app
  2. Press "t" key, or say "transport stop"
Ettapp commented 6 years ago

Proposition

Instead of using the last pressed point, waiting for a new pressed point after entering itinerary mode.