We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b7955b commit 0cf1f9eCopy full SHA for 0cf1f9e
src/main/java/io/appium/java_client/pagefactory/bys/builder/ByAll.java
@@ -45,8 +45,7 @@ public WebElement findElement(SearchContext context) {
45
return bys.stream()
46
.map(by -> getSearchingFunction(by).apply(context))
47
.filter(Optional::isPresent)
48
- .findFirst()
49
- .orElseThrow(() -> new NoSuchElementException("Cannot locate an element using " + toString()))
50
- .orElse(null);
+ .findFirst().map(Optional::get)
+ .orElseThrow(() -> new NoSuchElementException("Cannot locate an element using " + toString()));
51
}
52
0 commit comments