Fix:Core:Fix crash on FR when signal is received after starting navit.|Thanks stevenS...
authorkazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 18 Oct 2008 19:31:56 +0000 (19:31 +0000)
committerkazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 18 Oct 2008 19:31:56 +0000 (19:31 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1495 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/route.c

index df8016b..3b9d8c4 100644 (file)
@@ -412,7 +412,12 @@ route_pos_contains(struct route *this, struct item *item)
 int
 route_destination_reached(struct route *this)
 {
-       struct street_data *sd = this->pos->street;
+       struct street_data *sd = NULL;
+
+       if(! this->pos)
+         return 0;
+       
+       sd = this->pos->street;
 
        if (!this->path2) {
                return 0;
@@ -664,6 +669,7 @@ route_set_destination(struct route *this, struct pcoord *dst)
        this->dst=NULL;
        if (dst) {
                this->dst=route_find_nearest_street(this->ms, dst);
+               if(this->dst)
                route_info_distances(this->dst, dst->pro);
        }
        profile(1,"find_nearest_street");