Skip to content

Commit

Permalink
Merge pull request github#2 from sleekslush/master
Browse files Browse the repository at this point in the history
Adds check to make sure there are directions found
  • Loading branch information
Zakaria Zajac committed Oct 28, 2011
2 parents 723c3d1 + ad1b70c commit b046e2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scripts/directions.coffee
Expand Up @@ -5,6 +5,10 @@
parse_directions = (body) ->
directions = JSON.parse body
first_route = directions.routes[0]

if not first_route
return "Sorry, boss. Couldn't find directions"

final_directions = []

for leg in first_route.legs
Expand Down

0 comments on commit b046e2a

Please sign in to comment.