1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-25 06:50:09 +08:00

Fix contentToString

This commit is contained in:
Him188 2020-02-28 21:38:31 +08:00
parent 58e4c156e8
commit da8a78af12
2 changed files with 16 additions and 0 deletions
mirai-core/src
androidMain/kotlin/net/mamoe/mirai/utils
jvmMain/kotlin/net/mamoe/mirai/utils

View File

@ -0,0 +1,8 @@
package net.mamoe.mirai.utils
import kotlin.reflect.KProperty1
import kotlin.reflect.jvm.javaField
internal actual fun KProperty1<*, *>.getValueAgainstPermission(receiver: Any): Any? {
return this.javaField?.apply { isAccessible = true }?.get(receiver)
}

View File

@ -0,0 +1,8 @@
package net.mamoe.mirai.utils
import kotlin.reflect.KProperty1
import kotlin.reflect.jvm.javaField
internal actual fun KProperty1<*, *>.getValueAgainstPermission(receiver: Any): Any? {
return this.javaField?.apply { isAccessible = true }?.get(receiver)
}