APSIMInitiative / APSIM710

APSIM
https://www.apsim.info
30 stars 47 forks source link

ApsimX Dragging/copying a soil causes a null reference error #1394

Closed ApsimBot closed 5 years ago

ApsimBot commented 5 years ago

Legacy Bug ID: 1964 Author: Justin Date: 2014-10-17 14:43:04 +0000 UTC

Fails in the following code: Apsim.Serialise(model)

It passes in the soil correctly but returns null. Only seems to happen with the soils, other nodes work ok.

It also works if the soil is a child of the node being copied, e.g. a field. Copying the soil on it's own however crashes.

Not sure if it's related, but I also can't paste a soil from Apsoil into the simulation either. Gives the error: InvalidOperationException There was an error reflecting type 'Models.Soils.Soil'.

Line 902 of Xml.cs:  XmlSerializer serial = new XmlSerializer(type[0]);

ApsimBot commented 5 years ago

Author: hol353 Date: 2014-10-28 11:17:00 +0000 UTC

This has been fixed along with other problems with soils losing their names.