Fix bug: crash when no route is selected