Correct parsing of 'Media' XML element in PrimitiveBaseShape when reading an OAR file.

The code used to call Serializer.ReadElementContentAsString() and then expected to
pass the XML to PrimitiveBaseShape.FromXml to parse. This would throw as
ReadElementContentAsString does not allow any children of the element.
Reading with Serializer.ReadInnerXml() was the fix.
This was only not a problem because most often shapes don't have media and
most simulators don't output anything if the media array is empty.
httptests
Robert Adams 2017-06-04 20:51:56 -07:00
parent 4320758d97
commit fa5bf4fd0b
1 changed files with 2 additions and 1 deletions

View File

@ -1361,7 +1361,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader)
{
string value = reader.ReadElementContentAsString("Media", String.Empty);
// Get inner XML and pass to MediaList parser
string value = reader.ReadInnerXml();
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
}