[openstreetmap/openstreetmap-website] Prevent exceptions while reversing directions (#2521)

Holger Jeromin notifications at github.com
Sun Jan 26 10:08:11 UTC 2020


When reversing a route with full or partial empty `to` and `from` inputs, we get an exception.

Steps to reproduce.

- open directions, 
- enter something in `to` input.
- hit reverse directions
- the variable `to` is undefined, but the properties `lat` and `lng` are accessed.

![image](https://user-images.githubusercontent.com/2410353/73133630-d7695f80-402b-11ea-957c-82e76b2a375a.png)

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/2521

-- Commit Summary --

  * Prevent exceptions while reversing directions

-- File Changes --

    M app/assets/javascripts/index/directions.js (12)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/2521.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2521.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2521
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200126/391f3620/attachment-0001.htm>


More information about the rails-dev mailing list