mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
HackStudio: Don't save file when filename is empty
When saving a new file, save_as_action will return if the filename input was empty, but save_action would still try to save the file. Added a guard to make sure we never try to save files with empty filenames.
This commit is contained in:
parent
a9b387a1bf
commit
11c53a1944
Notes:
sideshowbarker
2024-07-17 19:02:55 +09:00
Author: https://github.com/Daste745
Commit: 11c53a1944
Pull-request: https://github.com/SerenityOS/serenity/pull/12402
1 changed files with 3 additions and 1 deletions
|
@ -695,7 +695,9 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_save_action()
|
|||
if (active_file().is_empty())
|
||||
m_save_as_action->activate();
|
||||
|
||||
current_editor_wrapper().save();
|
||||
// NOTE active_file() could still be empty after a cancelled save_as_action
|
||||
if (!active_file().is_empty())
|
||||
current_editor_wrapper().save();
|
||||
|
||||
if (m_git_widget->initialized())
|
||||
m_git_widget->refresh();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue