mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
HackStudio: Don't crash when saving is denied on build
When running build while having unsaved changes in HackStudio, it asks whether you want to save the unsaved files with a separate dialog. When you click "Yes" to saving the files, but deny the save-file dialog, HackStudio would crash, since we were expecting there to be a file to save to. Now, we check whether a file was picked, and if not, we abort the build.
This commit is contained in:
parent
88cc019275
commit
02cc2e0f8f
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/david072 🔰
Commit: 02cc2e0f8f
Pull-request: https://github.com/SerenityOS/serenity/pull/21728
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 11 additions and 4 deletions
|
@ -1678,7 +1678,8 @@ HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(Deprec
|
|||
if (result == GUI::MessageBox::ExecResult::Yes) {
|
||||
for (auto& editor_wrapper : m_all_editor_wrappers) {
|
||||
if (editor_wrapper->editor().document().is_modified()) {
|
||||
editor_wrapper->save();
|
||||
if (!editor_wrapper->save())
|
||||
return ContinueDecision::No;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue