EA-91810 - assert: NoSwingUnderWriteAction.lambda$watchForEvents$
[idea/community.git] / platform / lang-impl / src / com / intellij / refactoring / copy / CopyFilesOrDirectoriesHandler.java
index 4d7704a953b203b14537268069145f6d878e3621..089df084fb100f5ef843c9a76ce2f93df8094b37 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.ide.util.EditorHelper;
 import com.intellij.ide.util.PlatformPackageUtil;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.Result;
+import com.intellij.openapi.application.WriteAction;
 import com.intellij.openapi.command.WriteCommandAction;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -331,7 +332,7 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase {
       }
 
       if (selection == 0 && file != existing) {
-        existing.delete();
+        WriteAction.run(() -> existing.delete());
       }
       else {
         return true;