mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
PixelPaint: Don't crash when cancel is pressed when saving a file
Previously, we were attempting to add an empty string to the most recently open files list when no file was saved.
This commit is contained in:
parent
ecf41e13ad
commit
ad62e433f0
Notes:
sideshowbarker
2024-07-17 06:38:11 +09:00
Author: https://github.com/tcl3
Commit: ad62e433f0
Pull-request: https://github.com/SerenityOS/serenity/pull/23132
Issue: https://github.com/SerenityOS/serenity/issues/23130
3 changed files with 9 additions and 2 deletions
|
@ -763,6 +763,8 @@ void ImageEditor::save_project()
|
|||
return;
|
||||
}
|
||||
set_unmodified();
|
||||
if (on_file_saved)
|
||||
on_file_saved(path());
|
||||
}
|
||||
|
||||
void ImageEditor::save_project_as()
|
||||
|
@ -779,6 +781,8 @@ void ImageEditor::save_project_as()
|
|||
set_path(file.filename());
|
||||
set_loaded_from_image(false);
|
||||
set_unmodified();
|
||||
if (on_file_saved)
|
||||
on_file_saved(path());
|
||||
}
|
||||
|
||||
ErrorOr<void> ImageEditor::save_project_to_file(NonnullOwnPtr<Core::File> file) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue