Skip to content

Commit 3ed45b1

Browse files
author
Ven
committed
opt: 自动注册步骤器
1 parent 94b7df6 commit 3ed45b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

assists/src/main/java/com/ven/assist/step/StepManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ object StepManager {
3232
fun <T : StepImpl> execute(stepImpl: Class<T>, step: Int, delay: Long = Assists.Config.defaultStepDelay, data: Any? = null) {
3333
if (isStop) return
3434
LogUtils.d("execute->${stepImpl.name}:$step", "delay:$delay")
35+
stepCollector[stepImpl.name] ?: register(stepImpl)
3536
stepCollector[stepImpl.name]?.get(step)?.let {
3637
it.data = data
3738
it.execute(delay)
38-
} ?: throw RuntimeException("The class ${stepImpl.name} is not registered. Please call StepManager.register() to register it first./类${stepImpl.name}未注册,请先调用StepManager.register()进行注册")
39+
}
3940
}
4041

4142
/**

0 commit comments

Comments
 (0)