void () { try { VirtualFile file = pathToFile(); final String toWrite = myCodeEditor.getText(); String text = toWrite != null ? toWrite : ""; assert file != null; VfsUtil.saveText(file, text); myChanged = false; } catch (IOException e) { Messages.showErrorDialog(e.getMessage(), LangBundle.message("dialog.title.cannot.save.script")); } }