mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Check instanceReceiver before call
This commit is contained in:
parent
3b14d70cc5
commit
77e38dd964
@ -254,6 +254,10 @@ internal class CommandReflector(
|
||||
|
||||
val instanceParameter = function.instanceParameter
|
||||
if (instanceParameter != null) {
|
||||
check(instanceParameter.type.classifierAsKClass().isInstance(command)) {
|
||||
"Bad command call resolved. " +
|
||||
"Function expects instance parameter ${instanceParameter.type} whereas actual instance is ${command::class}."
|
||||
}
|
||||
args[instanceParameter] = command
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user