mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix invalid PSI access in debugger (EA-72005 - assert: EmptySubstitutorImpl.put)
This commit is contained in:
@@ -365,7 +365,7 @@ public class JVMNameUtil {
|
||||
return null;
|
||||
}
|
||||
final PsiElement element = position.getElementAt();
|
||||
return (element != null) ? PsiTreeUtil.getParentOfType(element, PsiClass.class, false) : null;
|
||||
return element != null && element.isValid() ? PsiTreeUtil.getParentOfType(element, PsiClass.class, false) : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.intellij.psi.impl;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -45,8 +46,8 @@ public final class EmptySubstitutorImpl extends EmptySubstitutor {
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiSubstitutor put(@NotNull PsiTypeParameter classParameter, PsiType mapping){
|
||||
if (mapping != null && !mapping.isValid()) {
|
||||
LOG.error("Invalid type in substitutor: " + mapping);
|
||||
if (mapping != null) {
|
||||
PsiUtil.ensureValidType(mapping);
|
||||
}
|
||||
return new PsiSubstitutorImpl(classParameter, mapping);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user