Skip to content

Commit 543780f

Browse files
committed
Addressing #4555 in WebElement.findElements too
1 parent 8e8f9f8 commit 543780f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/client/src/org/openqa/selenium/remote/RemoteWebElement.java

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
import java.io.File;
4848
import java.io.IOException;
49+
import java.util.Collections;
4950
import java.util.List;
5051
import java.util.Map;
5152

@@ -194,6 +195,9 @@ protected List<WebElement> findElements(String using, String value) {
194195
Response response = execute(DriverCommand.FIND_CHILD_ELEMENTS,
195196
ImmutableMap.of("id", id, "using", using, "value", value));
196197
Object responseValue = response.getValue();
198+
if (responseValue == null) { // see https://github.com/SeleniumHQ/selenium/issues/4555
199+
return Collections.emptyList();
200+
}
197201
List<WebElement> allElements;
198202
try {
199203
allElements = (List<WebElement>) responseValue;

0 commit comments

Comments
 (0)