From 7c2aca37369f7382ce5a9ddf13a55f03d5e84f03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 8 Jun 2023 18:01:33 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=94=8A=20log=20string=20leading=20to=20exc?= =?utf8?q?eption?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt index fd3d8c8..e497fdc 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/DefaultElementLoader.kt @@ -104,7 +104,7 @@ class DefaultElementLoader(private val freenetInterface: FreenetInterface, ticke } -private fun String.decode() = URLDecoder.decode(this, "UTF-8")!! +private fun String.decode() = try { URLDecoder.decode(this, "UTF-8")!! } catch (e: RuntimeException) { freenet.support.Logger.error(DefaultElementLoader::class.java, "Could not decode %s!".format(this), e); throw e } private fun String.normalize() = Normalizer.normalize(this, Normalizer.Form.NFC)!! private val String?.emptyToNull get() = if (this == "") null else this -- 2.7.4