From 38bb39a407a1edeba0ee31f75c6db18a3e7843cf Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 3 May 2025 16:15:20 -0400 Subject: [PATCH] Fixes bug when trying to detect the charset of the first 1024 bytes of the page. Since this is an invalid HTML, it was crashing here. --- .../com/vitorpamplona/amethyst/commons/preview/MetaTagsParser.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/commons/src/main/java/com/vitorpamplona/amethyst/commons/preview/MetaTagsParser.kt b/commons/src/main/java/com/vitorpamplona/amethyst/commons/preview/MetaTagsParser.kt index 589e0d64a..0a9e7c6ff 100644 --- a/commons/src/main/java/com/vitorpamplona/amethyst/commons/preview/MetaTagsParser.kt +++ b/commons/src/main/java/com/vitorpamplona/amethyst/commons/preview/MetaTagsParser.kt @@ -82,6 +82,7 @@ object MetaTagsParser { fun nextTag(): RawTag? { skipWhile { it != '<' } + if (this.exhausted()) return null consume() // read tag name