From 6ae800c8b3d050f6e03dcdd9462d28d07e09774b Mon Sep 17 00:00:00 2001 From: leafmoes Date: Fri, 15 Dec 2023 15:48:17 +0800 Subject: [PATCH] Fix NPE by purifying sideswipe. --- .../java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt b/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt index 8a71addb1be..0bc748c894f 100644 --- a/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt +++ b/app/src/main/java/cc/ioctl/hook/sideswipe/SimplifyQQSettingMe.kt @@ -65,7 +65,6 @@ import xyz.nextalone.util.throwOrTrue import java.lang.reflect.Array import java.lang.reflect.Modifier import java.util.SortedMap - //侧滑栏精简 @FunctionHookEntry @UiItemAgentEntry @@ -278,7 +277,10 @@ object SimplifyQQSettingMe : MultiItemDelayableHook("SimplifyQQSettingMe",target m.hookAfter { for (activeItem in activeItems) { if (items2Hide[activeItem] == it.args[0]) { - (it.result as View).setViewZeroSize() + if (it.result != null){ + val view = it.result as View + view.setViewZeroSize() + } } } }