mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed possible NPE
This commit is contained in:
@@ -63,7 +63,7 @@ public class PyTypeCheckerInspection extends PyInspection {
|
||||
final PyExpression source = node.getForPart().getSource();
|
||||
if (source != null) {
|
||||
final PyType type = myTypeEvalContext.getType(source);
|
||||
if (!PyTypeChecker.isUnknown(type) && !PyABCUtil.isSubtype(type, PyNames.ITERABLE)) {
|
||||
if (type != null && !PyTypeChecker.isUnknown(type) && !PyABCUtil.isSubtype(type, PyNames.ITERABLE)) {
|
||||
registerProblem(source, String.format("Expected 'collections.Iterable', got '%s' instead",
|
||||
PythonDocumentationProvider.getTypeName(type, myTypeEvalContext)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user