Commit 3c1ee33e authored by Him188's avatar Him188

Fix Java function resolving

parent abf367bd
......@@ -212,7 +212,7 @@ private fun Method.registerEvent(
coroutineContext: CoroutineContext
): Listener<Event> {
this.isAccessible = true
val kotlinFunction = this.kotlinFunction
val kotlinFunction = kotlin.runCatching { this.kotlinFunction }.getOrNull()
return if (kotlinFunction != null) {
// kotlin functions
......@@ -232,7 +232,9 @@ private fun Method.registerEvent(
else -> error("function ${kotlinFunction.name} must have one Event param")
}
lateinit var listener: Listener<*>
kotlinFunction.isAccessible = true
kotlin.runCatching {
kotlinFunction.isAccessible = true
}
suspend fun callFunction(event: Event): Any? {
try {
return when (param.size) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment