Skip to content

Commit

Permalink
make plugin more correctly serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanusMokrassar committed Feb 17, 2021
1 parent d3d5e70 commit ceb60e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/src/main/kotlin/dev/inmo/plagubot/PluginSerializer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ object PluginSerializer : KSerializer<Plugin> {
}
}

@InternalSerializationApi
override fun serialize(encoder: Encoder, value: Plugin) {
polymorphic.serialize(encoder, value)
val serializer = (value::class.serializerOrNull() ?: polymorphic) as KSerializer<Plugin>
serializer.serialize(encoder, value)
}
}

0 comments on commit ceb60e3

Please sign in to comment.