mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix NPE caused by non-qualifier in superclasses (PY-31285)
This commit is contained in:
@@ -32,7 +32,8 @@ import java.util.Map;
|
||||
public interface PyClassStub extends NamedStub<PyClass> {
|
||||
|
||||
/**
|
||||
* @return a {@code Map} which contains imported class names as keys and their original names as values
|
||||
* @return a {@code Map} which contains imported class names as keys and their original names as values.
|
||||
* <i>Note: the returned {@code Map} could contain nulls as keys and as values.</i>
|
||||
*/
|
||||
@NotNull
|
||||
Map<QualifiedName, QualifiedName> getSuperClasses();
|
||||
|
||||
@@ -525,7 +525,7 @@ public class PyTypingTypeProvider extends PyTypeProviderBase {
|
||||
if (pyClass != null && scopeOwner instanceof PyFunction) {
|
||||
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(context);
|
||||
|
||||
boolean isInstanceAttribute = false;
|
||||
boolean isInstanceAttribute;
|
||||
if (context.maySwitchToAST(target)) {
|
||||
isInstanceAttribute = StreamEx.of(PyUtil.multiResolveTopPriority(target.getQualifier(), resolveContext))
|
||||
.select(PyParameter.class)
|
||||
@@ -709,6 +709,7 @@ public class PyTypingTypeProvider extends PyTypeProviderBase {
|
||||
}
|
||||
}
|
||||
for (QualifiedName qName : allBaseClassesQNames) {
|
||||
if (qName == null) continue;
|
||||
final List<PsiElement> classes = PyResolveUtil.resolveQualifiedNameInScope(qName, (PyFile)pyClass.getContainingFile(), context);
|
||||
// Better way to handle results of the multiresove
|
||||
final PyClass firstFound = ContainerUtil.findInstance(classes, PyClass.class);
|
||||
|
||||
Reference in New Issue
Block a user