Fix NPE when one of class ancestors is unresolved in PyPep8NamingInspection
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Mon, 17 Nov 2014 12:31:45 +0000 (15:31 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Mon, 17 Nov 2014 12:47:44 +0000 (15:47 +0300)
python/src/com/jetbrains/python/inspections/PyPep8NamingInspection.java

index 9a584e0ffff4e55e1095a5a68744fecdceb074ad..1da2c46403e04efd944278d00187a5cad8917fdf 100644 (file)
@@ -136,7 +136,7 @@ public class PyPep8NamingInspection extends PyInspection {
         return true;
       }
       for (PyClassLikeType ancestor : pyClass.getAncestorTypes(myTypeEvalContext)) {
-        if (blackList.contains(ancestor.getClassQName())) {
+        if (ancestor != null && blackList.contains(ancestor.getClassQName())) {
           return true;
         }
       }