diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/WeakRef.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/WeakRef.kt index dbc6b0a45..13c2692a4 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/WeakRef.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/WeakRef.kt @@ -30,7 +30,7 @@ inline class UnsafeWeakRef(private val weakRef: WeakRef) { * val bot: Bot by param.unsafeWeakRef() * ``` */ -operator fun UnsafeWeakRef.getValue(thisRef: Any?, property: KProperty<*>): T = get() +operator fun UnsafeWeakRef.getValue(thisRef: Any?, property: KProperty<*>?): T = get() /** * Weak Reference. @@ -84,7 +84,7 @@ fun T.unsafeWeakRef(): UnsafeWeakRef = UnsafeWeakRef(this.weakRef()) * val bot: Bot? by param.weakRef() * ``` */ -operator fun WeakRef.getValue(thisRef: Any?, property: KProperty<*>): T? = this.get() +operator fun WeakRef.getValue(thisRef: Any?, property: KProperty<*>?): T? = this.get() /** * Call the block if the referent is absent