Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit ee6e5b56 authored by Harald Martini's avatar Harald Martini
Browse files

check if ArchitectureID exists before accessing it

parent 0d3d4482
Branches
Tags
No related merge requests found
...@@ -235,7 +235,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider ...@@ -235,7 +235,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
public virtual IVehicleComponentsDeclaration Components => _components ?? (_components = ComponentReader.ComponentInputData); public virtual IVehicleComponentsDeclaration Components => _components ?? (_components = ComponentReader.ComponentInputData);
public virtual string VehicleTypeApprovalNumber => ElementExists(XMLNames.VehicleTypeApprovalNumber) ? GetString(XMLNames.Vehicle_TypeApprovalNumber) : null; public virtual string VehicleTypeApprovalNumber => ElementExists(XMLNames.VehicleTypeApprovalNumber) ? GetString(XMLNames.Vehicle_TypeApprovalNumber) : null;
public virtual ArchitectureID ArchitectureID => ArchitectureIDHelper.Parse(GetString(XMLNames.Vehicle_ArchitectureID)); public virtual ArchitectureID ArchitectureID => ElementExists(XMLNames.Vehicle_ArchitectureID) ? ArchitectureIDHelper.Parse(GetString(XMLNames.Vehicle_ArchitectureID)) : ArchitectureID.UNKNOWN;
public virtual bool OvcHev => GetBool(XMLNames.Vehicle_OvcHev); public virtual bool OvcHev => GetBool(XMLNames.Vehicle_OvcHev);
public virtual Watt MaxChargingPower => ElementExists(XMLNames.Vehicle_MaxChargingPower) ? public virtual Watt MaxChargingPower => ElementExists(XMLNames.Vehicle_MaxChargingPower) ?
XmlConvert.ToInt32(GetString(XMLNames.Vehicle_MaxChargingPower)).SI<Watt>() : null; XmlConvert.ToInt32(GetString(XMLNames.Vehicle_MaxChargingPower)).SI<Watt>() : null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment