From d710870c65fb3f8b0700b5d5fbf39292cc7e9a7f Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 31 Mar 2021 12:53:12 +0300 Subject: [PATCH] Fix possible NPE --- .../java/org/teavm/model/optimization/Devirtualization.java | 3 +++ 1 file changed, 3 insertions(+) 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()) {