Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 65c09dce authored by Michael KRISPER's avatar Michael KRISPER Committed by Markus Quaritsch
Browse files

Pull request #242: Bugfix/VECTO-1620 xml conventionalbus retarder

Merge in VECTO/vecto-dev from VECTO/mk_vecto-dev:bugfix/VECTO-1620-xml-conventionalbus-retarder to develop

* commit 'f10ee287':
  AbstractXMLType: Throw meaningful error message on access to Null-References.
  Removed check for XML-Elements Angledrive and Retarder: An object with respective Type "None" should be returned in case of "None"
parents 3061fc15 f10ee287
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System;
using System.Collections.Generic;
using System.Xml;
using TUGraz.VectoCommon.Exceptions;
......@@ -136,12 +137,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Common {
protected virtual TableData ReadTableData(string baseElement, string entryElement, Dictionary<string, string> mapping)
{
var entries = BaseNode.SelectNodes(
XMLHelper.QueryLocalName(baseElement, entryElement));
if (entries != null && entries.Count > 0) {
return XMLHelper.ReadTableData(mapping, entries);
try {
var entries = BaseNode.SelectNodes(XMLHelper.QueryLocalName(baseElement, entryElement));
if (entries != null && entries.Count > 0) {
return XMLHelper.ReadTableData(mapping, entries);
}
} catch (NullReferenceException) {
throw new VectoException($"Could not find element: {baseElement} {entryElement}");
}
return null;
}
}
......
......@@ -191,16 +191,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider
IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData => null;
#region Overrides of XMLDeclarationComponentsDataProviderV10
public override IAngledriveInputData AngledriveInputData =>
ElementExists(XMLNames.Component_Angledrive) ? base.AngledriveInputData : null;
public override IRetarderInputData RetarderInputData =>
ElementExists(XMLNames.Component_Retarder) ? base.RetarderInputData : null;
#endregion
public override IBusAuxiliariesDeclarationData BusAuxiliaries =>
_busAuxiliaries ?? (_busAuxiliaries = ComponentReader.BusAuxiliariesInputData);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment