mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-17 05:35:07 +00:00
fix: Skip over invalid adapter ids when getting network information
This commit is contained in:
@@ -46,6 +46,9 @@ namespace ICD.Common.Utils
|
||||
try
|
||||
{
|
||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||
continue;
|
||||
|
||||
address = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
@@ -77,6 +80,9 @@ namespace ICD.Common.Utils
|
||||
try
|
||||
{
|
||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||
continue;
|
||||
|
||||
macAddress = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
@@ -105,6 +111,9 @@ namespace ICD.Common.Utils
|
||||
try
|
||||
{
|
||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||
return null;
|
||||
|
||||
string status = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||
|
||||
if (!string.IsNullOrEmpty(status) && !status.Equals(INVALID_VALUE))
|
||||
@@ -137,6 +146,9 @@ namespace ICD.Common.Utils
|
||||
try
|
||||
{
|
||||
short id = CrestronEthernetHelper.GetAdapterdIdForSpecifiedAdapterType(type);
|
||||
if (id >= InitialParametersClass.NumberOfEthernetInterfaces)
|
||||
continue;
|
||||
|
||||
hostname = CrestronEthernetHelper.GetEthernetParameter(param, id);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
|
||||
Reference in New Issue
Block a user