Skip to content

Commit

Permalink
Update SnowflakeCodec.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
NoComment1105 authored Oct 30, 2023
1 parent a1d3abf commit 9881a11
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ object SnowflakeCodec : Codec<Snowflake> {
}

override fun decode(reader: BsonReader, decoderContext: DecoderContext): Snowflake = try {
Snowflake(reader.readInt64())
} catch (_: BsonInvalidOperationException) {
Snowflake(reader.readString())
} catch (_: BsonInvalidOperationException) {
Snowflake(reader.readInt64())
}

override fun getEncoderClass(): Class<Snowflake> = Snowflake::class.java
Expand Down

0 comments on commit 9881a11

Please sign in to comment.