From 83790b1f7b580f52a3a20be163a2156a1f29471b Mon Sep 17 00:00:00 2001 From: Paul de Vrieze Date: Sun, 19 May 2024 14:57:02 +0100 Subject: [PATCH] Don't fail on incorrect service loader, just revert back to the other code. --- .../jvmMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.jvm.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/base/src/jvmMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.jvm.kt b/core/base/src/jvmMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.jvm.kt index 39fd71192..f443ac17b 100644 --- a/core/base/src/jvmMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.jvm.kt +++ b/core/base/src/jvmMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.jvm.kt @@ -67,7 +67,8 @@ public actual object XmlStreaming : XmlStreamingJavaCommon(), IXmlStreaming { if (f != null) return f - f = serviceLoader.firstOrNull() + // Ignore errors in the service loader, but fall back instead + f = try { serviceLoader.firstOrNull() } catch (e: ServiceConfigurationError) { null } if (f == null) { f = try {