Ticket #971: stop_navigation_workaround.diff

File stop_navigation_workaround.diff, 1.1 KB (added by tegzed, 9 years ago)

workaround for the stop navigation crash

  • bookmarks.c

     
    731731
    732732        former_destinations = read_former_destination_map_as_list(former_destination_map);
    733733
    734         new_dest = g_new(struct former_destination, 1);
    735         new_dest->type = type;
    736         new_dest->description = g_strdup(description);
    737         new_dest->c.x = c->x;
    738         new_dest->c.y = c->y;
    739         former_destinations = remove_destination_from_list(new_dest, former_destinations);
    740         former_destinations = g_list_append(former_destinations, new_dest);
    741 
     734        if(c) {
     735                new_dest = g_new(struct former_destination, 1);
     736                new_dest->type = type;
     737                new_dest->description = g_strdup(description);
     738                new_dest->c.x = c->x;
     739                new_dest->c.y = c->y;
     740                former_destinations = remove_destination_from_list(new_dest, former_destinations);
     741                former_destinations = g_list_append(former_destinations, new_dest);
     742        }
    742743        no_of_former_destinations = g_list_length(former_destinations);
    743744        if (limit > 0 && no_of_former_destinations > limit)
    744745                former_destinations_shortened = g_list_nth(former_destinations, no_of_former_destinations - limit);