mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +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:
parent
d42abb3c7b
commit
fd90e10600
1 changed files with 3 additions and 1 deletions
|
@ -56,8 +56,10 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
|
||||||
};
|
};
|
||||||
|
|
||||||
apply_button->on_click = [this](auto) {
|
apply_button->on_click = [this](auto) {
|
||||||
if (!m_selected_filter)
|
if (!m_selected_filter) {
|
||||||
done(ExecResult::ExecAborted);
|
done(ExecResult::ExecAborted);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_selected_filter->apply();
|
m_selected_filter->apply();
|
||||||
done(ExecResult::ExecOK);
|
done(ExecResult::ExecOK);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue