diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/MethodInvokeUtils.kt b/java/debugger/impl/src/com/intellij/debugger/engine/MethodInvokeUtils.kt index f737d2024832f..458db40d546b1 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/MethodInvokeUtils.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/MethodInvokeUtils.kt @@ -76,12 +76,12 @@ object MethodInvokeUtils { } fun getMethodHandlesImplLookup(evaluationContext: EvaluationContextImpl): ObjectReference? { - val theClass = evaluationContext.debugProcess.findClass(evaluationContext, - "java.lang.invoke.MethodHandles\$Lookup", - null) - val theField = DebuggerUtils.findField(theClass, - "IMPL_LOOKUP") - return theClass?.getValue(theField) as? ObjectReference + val theClass = runCatching { + // On Android API < 26, this will throw + evaluationContext.debugProcess.findClass(evaluationContext, "java.lang.invoke.MethodHandles\$Lookup", null) + }.getOrNull() ?: return null + val theField = DebuggerUtils.findField(theClass, "IMPL_LOOKUP") + return theClass.getValue(theField) as? ObjectReference } }