mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +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>
|
/// <param name="childElement"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
private static float? ReadChildElementContentAsFloat(string xml, string childElement)
|
public static float ReadChildElementContentAsFloat(string xml, string childElement)
|
||||||
{
|
{
|
||||||
string child = GetChildElementAsString(xml, childElement);
|
string child = GetChildElementAsString(xml, childElement);
|
||||||
using (IcdXmlReader reader = new IcdXmlReader(child))
|
using (IcdXmlReader reader = new IcdXmlReader(child))
|
||||||
@@ -518,6 +518,10 @@ namespace ICD.Common.Utils.Xml
|
|||||||
{
|
{
|
||||||
return ReadChildElementContentAsLong(xml, childElement);
|
return ReadChildElementContentAsLong(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (IcdXmlException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -556,6 +560,10 @@ namespace ICD.Common.Utils.Xml
|
|||||||
{
|
{
|
||||||
return ReadChildElementContentAsFloat(xml, childElement);
|
return ReadChildElementContentAsFloat(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (IcdXmlException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -594,6 +602,10 @@ namespace ICD.Common.Utils.Xml
|
|||||||
{
|
{
|
||||||
return ReadChildElementContentAsByte(xml, childElement);
|
return ReadChildElementContentAsByte(xml, childElement);
|
||||||
}
|
}
|
||||||
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user