KT-15870: run getTargetDirectory() in write action

This commit is contained in:
mglukhikh
2017-03-31 11:11:20 +03:00
committed by Mikhail Glukhikh
parent ee239d59aa
commit 1b2edf6a0c
@@ -63,7 +63,9 @@ class MoveFileToPackageMatchingDirectoryIntention : SelfTargetingOffsetIndepende
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())
return
}
val targetDirectory = targetDirFactory.getTargetDirectory(fileToMove) ?: return
val targetDirectory = runWriteAction {
targetDirFactory.getTargetDirectory(fileToMove)
} ?: return
RefactoringMessageUtil.checkCanCreateFile(targetDirectory, file.name)?.let {
Messages.showMessageDialog(project, it, CommonBundle.getErrorTitle(), Messages.getErrorIcon())