From f5e72400f021074c6f7fd1dcfa693c8f2dbe30ab Mon Sep 17 00:00:00 2001 From: ceneax Date: Mon, 6 Feb 2023 22:30:59 +0800 Subject: [PATCH] update --- .../ceneax/app/lib/astatine/core/AtInitSlots.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/astatine/src/main/java/ceneax/app/lib/astatine/core/AtInitSlots.kt b/astatine/src/main/java/ceneax/app/lib/astatine/core/AtInitSlots.kt index 6935fc3..d0616a9 100644 --- a/astatine/src/main/java/ceneax/app/lib/astatine/core/AtInitSlots.kt +++ b/astatine/src/main/java/ceneax/app/lib/astatine/core/AtInitSlots.kt @@ -22,13 +22,15 @@ internal class ParamAtInitSlots : AtInitSlots { } bundle?.keySet()?.forEach { - val filed = control.state::class.java.getDeclaredField(it) - if (!filed.isAnnotationPresent(Param::class.java)) { - return@forEach + runCatching { + val filed = control.state::class.java.getDeclaredField(it) + if (!filed.isAnnotationPresent(Param::class.java)) { + return@forEach + } + + filed.isAccessible = true + filed.set(control.state, bundle[it]) } - - filed.isAccessible = true - filed.set(control.state, bundle[it]) } } }