Commit 6afd86a9 authored by Gregory.Shrago's avatar Gregory.Shrago
Browse files

handle default project that can appear via Welcome Screen | Settings

parent 5c97abf4
Showing with 2 additions and 2 deletions
+2 -2
......@@ -80,7 +80,7 @@ public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase {
private static PsiDirectory tryNotNullizeDirectory(@NotNull Project project, @Nullable PsiDirectory defaultTargetDirectory) {
if (defaultTargetDirectory == null) {
VirtualFile root = FileChooserUtil.getLastOpenedFile(project);
if (root == null) root = ProjectUtil.guessProjectDir(project);
if (root == null) root = project.isDefault() ? null : ProjectUtil.guessProjectDir(project);
if (root == null) root = VfsUtil.getUserHomeDir();
defaultTargetDirectory = root == null ? null :
root.isDirectory() ? PsiManager.getInstance(project).findDirectory(root) :
......
......@@ -54,7 +54,7 @@ public final class FileChooserUtil {
VirtualFile result;
if (toSelect == null && lastPath == null) {
result = project == null ? null : ProjectUtil.guessProjectDir(project);
result = project == null || project.isDefault() ? null : ProjectUtil.guessProjectDir(project);
}
else if (toSelect != null && lastPath != null) {
if (Boolean.TRUE.equals(descriptor.getUserData(PathChooserDialog.PREFER_LAST_OVER_EXPLICIT))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment