From 39c6d8ebb10ca7f1025bb14ed547e01459b32cfa Mon Sep 17 00:00:00 2001 From: Username404 Date: Mon, 17 May 2021 14:56:52 +0200 Subject: [PATCH] Use the getDeclaredField() method instead of objectInstance in ButtonImpl.kt --- .../kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt index dc9ca7a..2b86fba 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt @@ -21,7 +21,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { ((try { it.getConstructor().newInstance() } catch (e: NoSuchMethodException) { - it.kotlin.objectInstance!! + it.getDeclaredField("INSTANCE").get(null) }) as ButtonImpl).let { impl -> with(impl) { if (info.kind == ButtonInfo.Companion.Type.TOGGLE) {