From 1cc298ef9c731c4d9c78779ef66e99cbe4bcd7ac Mon Sep 17 00:00:00 2001 From: NoComment <67918617+NoComment1105@users.noreply.github.com> Date: Fri, 15 Sep 2023 18:57:25 +0100 Subject: [PATCH] Update SnowflakeCodec.kt --- .../extensions/adapters/mongodb/codecs/SnowflakeCodec.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/data-adapters/adapter-mongodb/src/main/kotlin/com/kotlindiscord/kord/extensions/adapters/mongodb/codecs/SnowflakeCodec.kt b/data-adapters/adapter-mongodb/src/main/kotlin/com/kotlindiscord/kord/extensions/adapters/mongodb/codecs/SnowflakeCodec.kt index 55dae909a6..7b0c82a824 100644 --- a/data-adapters/adapter-mongodb/src/main/kotlin/com/kotlindiscord/kord/extensions/adapters/mongodb/codecs/SnowflakeCodec.kt +++ b/data-adapters/adapter-mongodb/src/main/kotlin/com/kotlindiscord/kord/extensions/adapters/mongodb/codecs/SnowflakeCodec.kt @@ -7,6 +7,7 @@ package com.kotlindiscord.kord.extensions.adapters.mongodb.codecs import dev.kord.common.entity.Snowflake +import org.bson.BsonInvalidOperationException import org.bson.BsonReader import org.bson.BsonWriter import org.bson.codecs.Codec @@ -15,10 +16,10 @@ import org.bson.codecs.EncoderContext public object SnowflakeCodec : Codec { override fun decode(reader: BsonReader, decoderContext: DecoderContext): Snowflake = try { - Snowflake(reader.readString()) - } catch (e: BsonInvalidOperationException) { - Snowflake(reader.readInt64()) - } + Snowflake(reader.readString()) + } catch (e: BsonInvalidOperationException) { + Snowflake(reader.readInt64()) + } override fun encode(writer: BsonWriter, value: Snowflake, encoderContext: EncoderContext) { writer.writeString(value.toString())