From ed5b75e16cba769b9305eb55b084fbe362371cc8 Mon Sep 17 00:00:00 2001 From: purofle Date: Sun, 18 Feb 2024 16:42:07 +0800 Subject: [PATCH] fix: NPE on generateRuleSet --- app/src/main/java/moe/matsuri/nb4a/SingBoxOptionsUtil.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/moe/matsuri/nb4a/SingBoxOptionsUtil.kt b/app/src/main/java/moe/matsuri/nb4a/SingBoxOptionsUtil.kt index d6a5b207..f24fb1ff 100644 --- a/app/src/main/java/moe/matsuri/nb4a/SingBoxOptionsUtil.kt +++ b/app/src/main/java/moe/matsuri/nb4a/SingBoxOptionsUtil.kt @@ -74,7 +74,7 @@ fun SingBoxOptions.DNSRule_DefaultOptions.checkEmpty(): Boolean { } fun SingBoxOptions.Rule_DefaultOptions.generateRuleSet(ruleSet: MutableList) { - rule_set.forEach { + rule_set?.forEach { when { it.startsWith("geoip") -> { val geoipPath = GeoipUtils.generateRuleSet(country = it.removePrefix("geoip:"))