1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

PixelPaint: Fix crash on applying with no filter selected

The wrong conception that done() would stop the program flow right there
lead to the lambda not properly aborting when no filter was selected.

The ExecAborted would be processed and then the nullptr that was
m_selected_filter would be happily dereferenced.

This patch fixes that.
This commit is contained in:
Tobias Christiansen 2022-01-04 17:27:07 +01:00 committed by Idan Horowitz
parent d42abb3c7b
commit fd90e10600

View file

@ -56,8 +56,10 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
};
apply_button->on_click = [this](auto) {
if (!m_selected_filter)
if (!m_selected_filter) {
done(ExecResult::ExecAborted);
return;
}
m_selected_filter->apply();
done(ExecResult::ExecOK);