From 6e5f9d154ed072ead75f5c44b9dd1988e94f88a6 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Mon, 26 Aug 2024 00:00:43 +0200 Subject: Fix: UninitializedPropertyAccessException in UnknownLinesHandler (#2407) --- .../skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt index bbae099d6..e77f670b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/UnknownLinesHandler.kt @@ -27,7 +27,7 @@ object UnknownLinesHandler { /** * Remove known lines with patterns **/ - val patternsToExclude = listOf( + val patternsToExclude = mutableListOf( PurseAPI.coinsPattern, SbPattern.motesPattern, BitsAPI.bitsScoreboardPattern, @@ -134,9 +134,12 @@ object UnknownLinesHandler { SbPattern.carnivalCatchStreakPattern, SbPattern.carnivalAccuracyPattern, SbPattern.carnivalKillsPattern, - *remoteOnlyPatterns, ) + if (::remoteOnlyPatterns.isInitialized) { + patternsToExclude.addAll(remoteOnlyPatterns) + } + unknownLines = unknownLines.filterNot { line -> patternsToExclude.any { pattern -> pattern.matches(line) } } -- cgit