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
slimupdates
Justin Clark-Casey (justincc) 2010-03-31 19:51:17 +01:00
parent 8cb81bdc9b
commit 2bf1761ad8
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)
{