mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 11:15:12 +00:00
Fixing issues parsing certain numeric types from xml
This commit is contained in:
@@ -401,7 +401,7 @@ namespace ICD.Common.Utils.Xml
|
||||
/// <param name="childElement"></param>
|
||||
/// <returns></returns>
|
||||
[PublicAPI]
|
||||
private static float? ReadChildElementContentAsFloat(string xml, string childElement)
|
||||
public static float ReadChildElementContentAsFloat(string xml, string childElement)
|
||||
{
|
||||
string child = GetChildElementAsString(xml, childElement);
|
||||
using (IcdXmlReader reader = new IcdXmlReader(child))
|
||||
@@ -518,6 +518,10 @@ namespace ICD.Common.Utils.Xml
|
||||
{
|
||||
return ReadChildElementContentAsLong(xml, childElement);
|
||||
}
|
||||
catch (IcdXmlException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
@@ -556,6 +560,10 @@ namespace ICD.Common.Utils.Xml
|
||||
{
|
||||
return ReadChildElementContentAsFloat(xml, childElement);
|
||||
}
|
||||
catch (IcdXmlException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
@@ -594,6 +602,10 @@ namespace ICD.Common.Utils.Xml
|
||||
{
|
||||
return ReadChildElementContentAsByte(xml, childElement);
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user