diff --git a/Portal.Gh/Components/Serialization/DeserializeGeometryComponent.cs b/Portal.Gh/Components/Serialization/DeserializeGeometryComponent.cs index d400ba7..33b7b2b 100644 --- a/Portal.Gh/Components/Serialization/DeserializeGeometryComponent.cs +++ b/Portal.Gh/Components/Serialization/DeserializeGeometryComponent.cs @@ -97,7 +97,16 @@ private PGeoType TryGetType(Payload payload) } string payloadJson = JsonConvert.SerializeObject(payload.Items); - JObject parsedObject = JObject.Parse(payloadJson); + JObject parsedObject; + try + { + parsedObject = JObject.Parse(payloadJson); + } + catch (JsonReaderException e) + { + return PGeoType.Undefined; + } + if (parsedObject["Type"] == null) { @@ -172,7 +181,7 @@ private Mesh DeserializeMesh(string data) { try { - dynamic pPoint = JsonConvert.DeserializeObject(data); + PVector3D pPoint = JsonConvert.DeserializeObject(data); if (pPoint == null) {