Catch case deserializing from EOS

This commit is contained in:
cinder
2024-12-29 10:42:43 -06:00
parent 2fd85a10e1
commit 9cdc8b6d8d

View File

@@ -1253,7 +1253,9 @@ namespace OpenMetaverse.StructuredData
if (!stream.CanSeek) { throw new OSDException("Cannot deserialize structured data from unseekable streams"); }
byte[] headerData = new byte[14];
stream.Read(headerData, 0, 14);
int read = stream.Read(headerData, 0, 14);
if (read == 0) { throw new System.IO.EndOfStreamException(); }
stream.Seek(0, SeekOrigin.Begin);
string header = Encoding.ASCII.GetString(headerData);