From 3b38cc10de9082a037f1aee81877a30b727eea81 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 31 Mar 2010 19:51:17 +0100 Subject: [PATCH] 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 --- OpenSim/Framework/Serialization/TarArchiveWriter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index 20d0f7e90b..0bd639ff3a 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs @@ -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) {