mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-13 15:52:11 +00:00
Ignore when failed to get file text
Relates to #KTIJ-706
This commit is contained in:
@@ -70,7 +70,15 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
PsiFile file = getContainingFile();
|
||||
if (!(file instanceof KtFile)) {
|
||||
// KtElementImpl.copy() might be the reason for this exception
|
||||
String fileString = file.isValid() ? (" " + file.getText()) : "";
|
||||
String fileString = "";
|
||||
if (file.isValid()) {
|
||||
try {
|
||||
fileString = " " + file.getText();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// ignore when failed to get file text
|
||||
}
|
||||
}
|
||||
// getNode() will fail if getContainingFile() returns not PsiFileImpl instance
|
||||
String nodeString = (file instanceof PsiFileImpl ? (" node = " + getNode()) : "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user