Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

When removing an image use the correct list ptr for presence verification #16391

Merged
merged 1 commit into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

The `symbolIntersectsTileEdges()` util in `mbgl::TilePlacement` now considers icon shift for the variable symbols with enabled icon-text-fit setting, thus providing more accurate results.

- [core] Correctly log a warning instead of crashing when a non-existent image is attempted to be removed. ([#16391](https://github.com/mapbox/mapbox-gl-native/pull/16391))

## maps-v1.5.1

### 🐞 Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/style/style_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void Style::Impl::removeImage(const std::string& id) {
auto newImages = makeMutable<ImageImpls>(*images);
auto found =
std::find_if(newImages->begin(), newImages->end(), [&id](const auto& image) { return image->id == id; });
if (found == images->end()) {
if (found == newImages->end()) {
Log::Warning(Event::General, "Image '%s' is not present in style, cannot remove", id.c_str());
return;
}
Expand Down