diff --git a/core/src/main/java/org/teavm/model/optimization/Devirtualization.java b/core/src/main/java/org/teavm/model/optimization/Devirtualization.java index 1327875f0..62f6e2616 100644 --- a/core/src/main/java/org/teavm/model/optimization/Devirtualization.java +++ b/core/src/main/java/org/teavm/model/optimization/Devirtualization.java @@ -141,6 +141,9 @@ public class Devirtualization { private void applyToCast(MethodDependencyInfo methodDep, CastInstruction cast) { ValueDependencyInfo var = methodDep.getVariable(cast.getValue().getIndex()); + if (var == null) { + return; + } boolean canFail = false; String failType = null; for (String type : var.getTypes()) {