From 14dd352cb612c3c6ef36be73747ab15ae76daeaf Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Thu, 12 Mar 2015 20:24:33 +0300 Subject: [PATCH] Fix exception thrown with incomplete classpath --- teavm-core/src/main/java/org/teavm/javascript/Decompiler.java | 2 +- .../main/java/org/teavm/jso/plugin/JSODependencyListener.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java index 0f3fb7a5b..d3d16f0d0 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Decompiler.java @@ -120,7 +120,7 @@ public class Decompiler { } ClassHolder cls = classSource.get(className); if (cls == null) { - throw new IllegalArgumentException("Class not found: " + className); + return; } if (cls.getParent() != null) { orderClasses(cls.getParent(), visited, order); diff --git a/teavm-jso/src/main/java/org/teavm/jso/plugin/JSODependencyListener.java b/teavm-jso/src/main/java/org/teavm/jso/plugin/JSODependencyListener.java index d97d80a0a..997323275 100644 --- a/teavm-jso/src/main/java/org/teavm/jso/plugin/JSODependencyListener.java +++ b/teavm-jso/src/main/java/org/teavm/jso/plugin/JSODependencyListener.java @@ -74,6 +74,9 @@ class JSODependencyListener implements DependencyListener { private ExposedClass createExposedClass(String name) { ClassReader cls = classSource.get(name); ExposedClass exposedCls = new ExposedClass(); + if (cls == null) { + return exposedCls; + } if (cls.getParent() != null && !cls.getParent().equals(cls.getName())) { ExposedClass parent = getExposedClass(cls.getParent()); exposedCls.inheritedMethods.putAll(parent.inheritedMethods);