summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorDaste <stefankar1000@gmail.com>2022-02-10 17:42:53 +0100
committerIdan Horowitz <idan.horowitz@gmail.com>2022-02-10 21:41:05 +0200
commit542e18b367dc7d4a55e9abcda563207c182fdc7c (patch)
tree8fdbc700564d8fccfca147e520e2eced2cb5fb59 /Userland/DevTools
parent11c53a194424d671e8ecd594dd3f86c7025ed61b (diff)
downloadserenity-542e18b367dc7d4a55e9abcda563207c182fdc7c.zip
HackStudio: Fix error handling logic in delete_action
The `result.is_error()` check was inverted, causing a crash.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/HackStudio/HackStudioWidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
index ff1bf6de40..de9cc2a485 100644
--- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp
@@ -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(),