]> err.no Git - mapper/commitdiff
Check that route waypoint point is valid
authorKaj-Michael Lang <milang@angel.tal.org>
Thu, 25 Oct 2007 12:44:34 +0000 (15:44 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Thu, 25 Oct 2007 12:44:34 +0000 (15:44 +0300)
src/route.c

index f3e064b4bffb363dfda68ff5ec2a06ab32a86012..fbbf7472c6e47c894f5b560200461f87632a54cc 100644 (file)
@@ -756,10 +756,15 @@ gfloat sum=0.0;
 if (_route.whead==_route.wtail)
        return NULL;
 
-store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
 wcurr = _route.whead;
+
+if (!wcurr->point)
+       return NULL;
+
 unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat1, lon1);
 
+store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+
 while (wcurr!=_route.wtail) {
        if (!wcurr)
                break;