handle invalid elements in hard smart pointers (EA-85743 - PIEAE: SubstrateRef$.getCo... appcode/171.1026
authorpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 18:44:31 +0000 (19:44 +0100)
committerpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 18:46:44 +0000 (19:46 +0100)
platform/core-impl/src/com/intellij/psi/impl/smartPointers/HardElementInfo.java

index a88db5febb742fc4850b86ee31f734e8b1e1e225..6fe4bbd8fe952d32c5d4eee6ae9696233ccaa35e 100644 (file)
@@ -47,7 +47,7 @@ class HardElementInfo extends SmartPointerElementInfo {
 
   @Override
   public PsiFile restoreFile() {
-    return myElement.getContainingFile();
+    return myElement.isValid() ? myElement.getContainingFile() : null;
   }
 
   @Override