Guarding against null return value from findElements in .NET.
Fixes issue 4555 for .NET.
@@ -1042,6 +1042,8 @@ internal ReadOnlyCollection<IWebElement> GetElementsFromResponse(Response respon
{
List<IWebElement> toReturn = new List<IWebElement>();
object[] elements = response.Value as object[];
+ if (elements != null)
+ {
foreach (object elementObject in elements)
{
Dictionary<string, object> elementDictionary = elementObject as Dictionary<string, object>;
@@ -1063,6 +1065,7 @@ internal ReadOnlyCollection<IWebElement> GetElementsFromResponse(Response respon
toReturn.Add(element);
}
}
+ }
return toReturn.AsReadOnly();
}
