From 2439452fec53dffac5c03c0aea6438bd7fca94f3 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Thu, 25 May 2023 02:35:25 -0500 Subject: [PATCH] Fix invalid BSON --- UIX/Microsoft/Iris/Debug/BsonFormatter.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UIX/Microsoft/Iris/Debug/BsonFormatter.cs b/UIX/Microsoft/Iris/Debug/BsonFormatter.cs index 9def495..46fbc66 100644 --- a/UIX/Microsoft/Iris/Debug/BsonFormatter.cs +++ b/UIX/Microsoft/Iris/Debug/BsonFormatter.cs @@ -44,7 +44,7 @@ internal class BsonFormatter : IFormatter // If the type is accessible from the current domain, // create an instance of it. - var typeName = _serializer.Deserialize(reader); + var typeName = reader.ReadAsString(); var type = Type.GetType(typeName); if (type != null) return _serializer.Deserialize(reader, type); @@ -55,8 +55,12 @@ internal class BsonFormatter : IFormatter public void Serialize(Stream serializationStream, object graph) { using BsonDataWriter writer = new(serializationStream); - _serializer.Serialize(writer, graph?.GetType().FullName); + + writer.WriteStartArray(); + writer.WriteValue(graph?.GetType().FullName); _serializer.Serialize(writer, graph); + writer.WriteEndArray(); + writer.Flush(); } }