diff --git a/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java b/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java index 2cbd2ed4985c..7194c7ce4ac5 100644 --- a/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java +++ b/java/java-runtime/src/com/intellij/rt/debugger/MethodInvoker.java @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.rt.debugger; import java.lang.invoke.MethodHandle; @@ -188,6 +188,10 @@ public final class MethodInvoker { method = lookup.findStatic(cls, name, mt); } + if (method == null) { + throw new NoSuchMethodException(nameAndDescriptor + " not found in " + cls); + } + int parameterCount = mt.parameterCount(); Class lastParameterType = parameterCount > 0 ? mt.parameterType(parameterCount - 1) : null; boolean vararg = method.isVarargsCollector();