Skip to content

Commit

Permalink
Avoid crash with roads that don't belong to any cell. #71
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jan 5, 2025
1 parent 12e698b commit f438760
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/neighbourhood.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ impl Neighbourhood {
map.directions[&r] != Direction::from_osm(&road.tags),
);
f.set_property("road", r.0);
f.set_property("cell_color", derived.render_cells.colors_per_road[&r]);
if let Some(color) = derived.render_cells.colors_per_road.get(&r) {
f.set_property("cell_color", *color);
}

features.push(f);
}
Expand Down

0 comments on commit f438760

Please sign in to comment.