Modify change when args is null throw exception in HookParam

This commit is contained in:
2022-08-26 22:33:22 +08:00
parent 25e3dd2d59
commit e3d9802b8d

View File

@@ -71,8 +71,9 @@ class HookParam internal constructor(private val createrInstance: YukiMemberHook
* *
* 这里的数组每项类型默认为 [Any] - 你可以使用 [args] 方法来实现 [ArgsModifyer.cast] 功能 * 这里的数组每项类型默认为 [Any] - 你可以使用 [args] 方法来实现 [ArgsModifyer.cast] 功能
* @return [Array] * @return [Array]
* @throws IllegalStateException 如果对象为空
*/ */
val args get() = param?.args ?: arrayOf(0) val args get() = param?.args ?: error("Current hooked Member args is null")
/** /**
* 获取当前 Hook 实例的对象 * 获取当前 Hook 实例的对象