when removing an image use the correct list ptr for presence verification
This fixes an issues where calling `removeImage` would crash if the image was not present and the original list was not empty.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user