Do not call preformat processors for invalid PSI [CR-IC-1847]

This commit is contained in:
Rustam Vishnyakov
2013-08-07 13:17:09 +04:00
parent 244240da53
commit 3221387cd7
@@ -255,10 +255,7 @@ public class CodeFormatterFacade {
private static TextRange preprocess(@NotNull final ASTNode node, @NotNull TextRange range) {
TextRange result = range;
PsiElement psi = node.getPsi();
if (!psi.isValid()) {
for(PreFormatProcessor processor: Extensions.getExtensions(PreFormatProcessor.EP_NAME)) {
result = processor.process(node, result);
}
if (!psi.isValid()) {
return result;
}