Parcourir la source

HackStudio: Fix error handling logic in delete_action

The `result.is_error()` check was inverted, causing a crash.
Daste il y a 3 ans
Parent
commit
542e18b367
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Userland/DevTools/HackStudio/HackStudioWidget.cpp

+ 1 - 1
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(),