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

HackStudio: Fix error handling logic in delete_action

The `result.is_error()` check was inverted, causing a crash.
This commit is contained in:
Daste 2022-02-10 17:42:53 +01:00 committed by Idan Horowitz
parent 11c53a1944
commit 542e18b367

View file

@ -553,7 +553,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
}
bool is_directory = S_ISDIR(st.st_mode);
if (auto result = Core::File::remove(file, Core::File::RecursionMode::Allowed, false); !result.is_error()) {
if (auto result = Core::File::remove(file, Core::File::RecursionMode::Allowed, false); result.is_error()) {
auto& error = result.error();
if (is_directory) {
GUI::MessageBox::show(window(),