final PsiDirectory directory = view.getOrChooseDirectory();
if (directory == null) {
return;
}
GeneratorDialog dialog;
<BUG>PsiFile file = directory.findFile(fileType.getIgnoreLanguage().getFilename());

if (file == null) {
CreateFileCommandAction action = new CreateFileCommandAction(project, directory, fileType);</BUG>
dialog = new GeneratorDialog(project, action);

final PsiDirectory directory = view.getOrChooseDirectory();
if (directory == null) {
return;
}
GeneratorDialog dialog;
String filename = fileType.getIgnoreLanguage().getFilename();
PsiFile file = directory.findFile(filename);
VirtualFile virtualFile = file == null ? directory.getVirtualFile().findChild(filename) : file.getVirtualFile();
if (file == null && virtualFile == null) {
CreateFileCommandAction action = new CreateFileCommandAction(project, directory, fileType);
dialog = new GeneratorDialog(project, action);
