From 48c2fc4c898163be7d2ffb316895ec6e654c732c Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 5 Jun 2014 14:14:46 +0200 Subject: [PATCH] special PIEAE handling for NULL_PSI_ELEMENT (its getUserData throws exceptions) --- .../src/com/intellij/psi/PsiInvalidElementAccessException.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java b/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java index 284b80401cea..fb2ae2ce4d21 100644 --- a/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java +++ b/platform/core-api/src/com/intellij/psi/PsiInvalidElementAccessException.java @@ -62,6 +62,9 @@ public class PsiInvalidElementAccessException extends RuntimeException implement if (element == null) { myMessage = message; myDiagnostic = Attachment.EMPTY_ARRAY; + } else if (element == PsiUtilCore.NULL_PSI_ELEMENT) { + myMessage = "NULL_PSI_ELEMENT ;" + message; + myDiagnostic = Attachment.EMPTY_ARRAY; } else { boolean recursiveInvocation = Boolean.TRUE.equals(element.getUserData(REPORTING_EXCEPTION)); element.putUserData(REPORTING_EXCEPTION, Boolean.TRUE);