From 473e04ea11e53303cd89b2bceb9ecc7005a81582 Mon Sep 17 00:00:00 2001 From: mkx173 Date: Tue, 23 Jul 2024 02:48:33 -0700 Subject: [PATCH] fix: NullPointerException in refreshCache --- app/src/main/java/gm/tieba/tabswitch/dao/Adp.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/gm/tieba/tabswitch/dao/Adp.kt b/app/src/main/java/gm/tieba/tabswitch/dao/Adp.kt index 0cc2c5a9..f2a643af 100644 --- a/app/src/main/java/gm/tieba/tabswitch/dao/Adp.kt +++ b/app/src/main/java/gm/tieba/tabswitch/dao/Adp.kt @@ -30,8 +30,8 @@ object Adp : XposedContext() { hookBeforeMethod("tbclient.ForumRecommend.DataRes\$Builder", "build", Boolean::class.javaPrimitiveType) { param -> val forums: MutableSet = HashSet() - val likeForumList = XposedHelpers.getObjectField(param.thisObject, "like_forum") as List<*> - likeForumList.forEach { forums.add(XposedHelpers.getObjectField(it, "forum_name") as String) } + val likeForumList = XposedHelpers.getObjectField(param.thisObject, "like_forum") as? List<*> + likeForumList?.forEach { forums.add(XposedHelpers.getObjectField(it, "forum_name") as String) } putLikeForum(forums) } }