Skip to content

Commit a4338ba

Browse files
committed
fix cond
1 parent b7fbcc4 commit a4338ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ internal class KotlinValueInstantiator(
7171
possibleCompanion.objectInstance
7272
} catch (ex: IllegalAccessException) {
7373
// fallback for when an odd access exception happens through Kotlin reflection
74-
val companionField = possibleCompanion.java.enclosingClass.fields.firstOrNull { it.name == "Companion" }
74+
val companionField = possibleCompanion.java.enclosingClass.fields.firstOrNull { it.type.kotlin.isCompanion }
7575
?: throw ex
7676
val accessible = companionField.isAccessible
7777
if ((!accessible && ctxt.config.isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)) ||

0 commit comments

Comments
 (0)