mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-38373 - NPE: PythonReferenceImporter.addImportViaElement
This commit is contained in:
@@ -166,7 +166,10 @@ public class PythonReferenceImporter implements ReferenceImporter {
|
||||
PsiElement source) {
|
||||
PsiElement sourceFile = PyUtil.turnDirIntoInit(source);
|
||||
if (sourceFile instanceof PyFileImpl) {
|
||||
seenFileNames.add(importElement.getImportReferenceExpression().getReferencedName());
|
||||
PyReferenceExpression importReferenceExpression = importElement.getImportReferenceExpression();
|
||||
if (importReferenceExpression != null) {
|
||||
seenFileNames.add(importReferenceExpression.getReferencedName());
|
||||
}
|
||||
PyFileImpl importSourceFile = (PyFileImpl)sourceFile;
|
||||
PsiElement res = importSourceFile.findExportedName(refText);
|
||||
// allow importing from this source if it either declares the name itself or represents a higher-level package that reexports the name
|
||||
|
||||
Reference in New Issue
Block a user