From c7cb25c19022f3cad69a5add6d7845cab6b77fd5 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:52:02 +0100 Subject: [PATCH] fix(core/wrapper): param map field In versions higher than 13.22.0.61, the paramMap field is no longer typed as a ConcurrentHashMap Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com> --- .../rhunk/snapenhance/core/wrapper/impl/media/opera/ParamMap.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/wrapper/impl/media/opera/ParamMap.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/wrapper/impl/media/opera/ParamMap.kt index 64109d43..32a1f9f3 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/wrapper/impl/media/opera/ParamMap.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/wrapper/impl/media/opera/ParamMap.kt @@ -10,7 +10,7 @@ import java.util.concurrent.ConcurrentHashMap class ParamMap(obj: Any?) : AbstractWrapper(obj) { private val paramMapField: Field by lazy { instanceNonNull()::class.java.findFields(once = true) { - it.type == ConcurrentHashMap::class.java + it.type == ConcurrentHashMap::class.java || runCatching { it.get(instance) }.getOrNull() is ConcurrentHashMap<*, *> }.firstOrNull() ?: throw RuntimeException("Could not find paramMap field") }