Wrap array indexing in try/catch

This commit is contained in:
dhbrett 2016-06-14 11:59:04 -07:00
Родитель fb6f80bd93
Коммит 32e784da5e
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -1729,10 +1729,17 @@ namespace Microsoft.Edge.A11y
result += "\nElement did not have HelpText";
}
var helpPane = invalidElement.CurrentControllerFor.GetElement(0);
if (helpPane.CurrentControlType != new ElementConverter().GetElementCodeFromName("Pane"))
try
{
result += "Error message did not have correct ControlType";
var helpPane = invalidElement.CurrentControllerFor.GetElement(0);
if (helpPane.CurrentControlType != new ElementConverter().GetElementCodeFromName("Pane"))
{
result += "\nError message did not have correct ControlType";
}
}
catch
{
result += "\nUnable to get controller for";
}
}