When saving an oar/iar, don't attempt to write out the data byte array if it's empty

On Mono 2.6 (and probably before) this causes a non-obvious IOException
0.6.9-post-fixes
Justin Clark-Casey (justincc) 2010-03-31 19:51:17 +01:00
parent d446b19e72
commit 3b38cc10de
1 changed files with 3 additions and 1 deletions

View File

@ -208,7 +208,9 @@ namespace OpenSim.Framework.Serialization
m_bw.Write(header);
// Write out data
m_bw.Write(data);
// An IOException occurs if we try to write out an empty array in Mono 2.6
if (data.Length > 0)
m_bw.Write(data);
if (data.Length % 512 != 0)
{