summaryrefslogtreecommitdiff
path: root/navit/route.c
diff options
context:
space:
mode:
authorbustersnyvel <bustersnyvel@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-07-27 15:16:21 +0000
committerbustersnyvel <bustersnyvel@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-07-27 15:16:21 +0000
commit525039545eafc4e6c42e23b45724bafa165df023 (patch)
treea619f21c18dc249e88854a11661abe1390ce4ad9 /navit/route.c
parent752f1733fe7b170ebe940726b5286dde34f013bb (diff)
downloadnavit-525039545eafc4e6c42e23b45724bafa165df023.tar.gz
fix:core:segfault when no streets are loaded
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2419 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/route.c')
-rw-r--r--navit/route.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/navit/route.c b/navit/route.c
index e0dc43aa0..7f9898331 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -725,10 +725,12 @@ route_set_position(struct route *this, struct pcoord *pos)
route_info_free(this->pos);
this->pos=NULL;
this->pos=route_find_nearest_street(this->vehicleprofile, this->ms, pos);
+
+ // If there is no nearest street, bail out.
+ if (!this->pos) return;
+
this->pos->street_direction=0;
dbg(1,"this->pos=%p\n", this->pos);
- if (! this->pos)
- return;
route_info_distances(this->pos, pos->pro);
route_path_update(this, 0, 1);
}