diff --git a/modules/circe/src/main/scala/mongo4cats/circe/CirceJsonMapper.scala b/modules/circe/src/main/scala/mongo4cats/circe/CirceJsonMapper.scala index 290b1d01..bafe19c7 100644 --- a/modules/circe/src/main/scala/mongo4cats/circe/CirceJsonMapper.scala +++ b/modules/circe/src/main/scala/mongo4cats/circe/CirceJsonMapper.scala @@ -104,7 +104,7 @@ private[circe] object CirceJsonMapper extends JsonMapper[Json] { binaryBase64ToJson(Uuid.toBase64(uuid), "04") def jsonToBinaryBase64(json: Json): Option[String] = - json.asObject.get(Tag.binary).flatMap(_.asObject).get("base64").flatMap(_.asString) + json.asObject.flatMap(_.apply(Tag.binary)).flatMap(_.asObject).flatMap(_.apply("base64")).flatMap(_.asString) def jsonToUuid(json: Json): UUID = Uuid.fromBase64(jsonToBinaryBase64(json).get)