[coroutines-debuuger] Fix CoroutinesDebugHelper#dumpCoroutinesInfoAsJsonAndReferences return null in case of an error

GitOrigin-RevId: d0a7ff5f6ea4932ca570044ec348aabd1bdb95d4
This commit is contained in:
Maria Sokolova
2025-02-17 14:47:45 +01:00
committed by intellij-monorepo-bot
parent f282f68b1e
commit 78427051ef

View File

@@ -146,10 +146,14 @@ public final class CoroutinesDebugHelper {
public static Object[] dumpCoroutinesInfoAsJsonAndReferences() throws ReflectiveOperationException {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
Class<?> debugProbesImplClass = classLoader.loadClass("kotlinx.coroutines.debug.internal.DebugProbesImpl");
Object debugProbesImplInstance = debugProbesImplClass.getField("INSTANCE").get(null);
Object[] infos = (Object[])invoke(debugProbesImplInstance, "dumpCoroutinesInfoAsJsonAndReferences");
return infos;
} catch (Throwable e) {
return null;
}
}
/**