From 3c00bd3e492c84bb82c07d51badd8e606f7a38f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Thu, 21 Dec 2017 20:45:41 +0100 Subject: [PATCH] fix error 500 when routing from outside spaces --- src/c3nav/routing/router.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c3nav/routing/router.py b/src/c3nav/routing/router.py index bd0d6b54..f3485493 100644 --- a/src/c3nav/routing/router.py +++ b/src/c3nav/routing/router.py @@ -291,6 +291,8 @@ class Router: point = Point(location.x, location.y) location = RouterPoint(location) space = self.space_for_point(location.level.pk, point, restrictions) + if space is None: + raise LocationUnreachable altitudearea = space.altitudearea_for_point(point) location.altitude = altitudearea.get_altitude(point) location_nodes = altitudearea.nodes_for_point(point, all_nodes=self.nodes)