[Jython-checkins] jython: Fix the fact that superclass can be null in makeProxy

frank.wierzbicki jython-checkins at python.org
Sat Dec 22 20:52:05 CET 2012


http://hg.python.org/jython/rev/4fea52cd30e2
changeset:   6907:4fea52cd30e2
user:        Darjus Loktevic <darjus at gmail.com>
date:        Mon Oct 15 22:59:47 2012 -0700
summary:
  Fix the fact that superclass can be null in makeProxy

files:
  src/org/python/core/MakeProxies.java |  10 ++++++----
  1 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/src/org/python/core/MakeProxies.java b/src/org/python/core/MakeProxies.java
--- a/src/org/python/core/MakeProxies.java
+++ b/src/org/python/core/MakeProxies.java
@@ -54,10 +54,12 @@
         JavaMaker javaMaker = null;
         
         // check if a Jython annotation exists and if yes, the class is already a Jython Proxy
-        APIVersion apiVersion = superclass.getAnnotation(org.python.compiler.APIVersion.class);
-        if (apiVersion != null) {
-            // TODO validate versions, maybe use a different annotation
-            return superclass;
+        if (superclass != null) {
+        	APIVersion apiVersion = superclass.getAnnotation(org.python.compiler.APIVersion.class);
+        	if (apiVersion != null) {
+        		// TODO validate versions, maybe use a different annotation
+        		return superclass;
+        	}
         }
         
         Class<?>[] interfaces = vinterfaces.toArray(new Class<?>[vinterfaces.size()]);

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list