fix: use null-safe access for matcher.group(1) in fullTextBuilder

Prevents potential NPE when imgPattern matches but group(1) is null.
This commit is contained in:
HapeLee
2026-06-06 02:59:29 +08:00
parent cb5108933e
commit 63daf5d842
@@ -288,7 +288,7 @@ class TextChapterLayout(
val matcher = AppPattern.imgPattern.matcher(text)
var start = 0
while (matcher.find()) {
val imgSrc = matcher.group(1)!!
val imgSrc = matcher.group(1) ?: continue
val iStyle = if (imgSrc.contains("TEXT")) "text" else imageStyle
if (start < matcher.start()) {
fullTextBuilder.append(text.substring(start, matcher.start()))