From 0359be8a2f9aad5a0fd1943eacce5a7ace86fe16 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 15 Jun 2010 21:43:14 +0400 Subject: [PATCH] EA-20542 - NPE: PyClassType.getClassQName --- python/src/com/jetbrains/python/psi/types/PyClassType.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/psi/types/PyClassType.java b/python/src/com/jetbrains/python/psi/types/PyClassType.java index 02cfa22d4c8e..a0b97415298e 100644 --- a/python/src/com/jetbrains/python/psi/types/PyClassType.java +++ b/python/src/com/jetbrains/python/psi/types/PyClassType.java @@ -26,8 +26,8 @@ import java.util.*; */ public class PyClassType implements PyType { - protected PyClass myClass; - protected boolean myIsDefinition; + protected final PyClass myClass; + protected final boolean myIsDefinition; /** * Describes a class-based type. Since everything in Python is an instance of some class, this type pretty much completes @@ -58,8 +58,9 @@ public class PyClassType implements PyType { return myIsDefinition; } + @Nullable public String getClassQName() { - return myClass.getQualifiedName(); + return myClass == null ? null : myClass.getQualifiedName(); } @Nullable