From c82ed6746a113e25024a68e6776e4dae0ac4f06c Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 22 Oct 2017 20:22:24 +0300 Subject: [PATCH] Fix compilation of WebAssembly samples --- .../java/org/teavm/model/classes/VirtualTableProvider.java | 3 +++ .../java/org/teavm/model/lowlevel/ManagedMethodRepository.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/model/classes/VirtualTableProvider.java b/core/src/main/java/org/teavm/model/classes/VirtualTableProvider.java index 6babd9054..9c4a9ef87 100644 --- a/core/src/main/java/org/teavm/model/classes/VirtualTableProvider.java +++ b/core/src/main/java/org/teavm/model/classes/VirtualTableProvider.java @@ -61,6 +61,9 @@ public class VirtualTableProvider { VirtualTable table = new VirtualTable(className); virtualTables.put(className, table); ClassReader cls = classSource.get(className); + if (cls == null) { + return; + } if (cls.getParent() != null) { fillClass(cls.getParent()); VirtualTable parentTable = virtualTables.get(cls.getParent()); diff --git a/core/src/main/java/org/teavm/model/lowlevel/ManagedMethodRepository.java b/core/src/main/java/org/teavm/model/lowlevel/ManagedMethodRepository.java index af9826f1c..2f8c993be 100644 --- a/core/src/main/java/org/teavm/model/lowlevel/ManagedMethodRepository.java +++ b/core/src/main/java/org/teavm/model/lowlevel/ManagedMethodRepository.java @@ -44,6 +44,6 @@ public class ManagedMethodRepository { return false; } MethodReader method = cls.getMethod(methodReference.getDescriptor()); - return method.getAnnotations().get(Unmanaged.class.getName()) == null; + return method == null || method.getAnnotations().get(Unmanaged.class.getName()) == null; } }