Skip to content

Commit 0cf1f9e

Browse files
committed
Fixes after review
1 parent 5b7955b commit 0cf1f9e

File tree

1 file changed

+2
-3
lines changed
  • src/main/java/io/appium/java_client/pagefactory/bys/builder

1 file changed

+2
-3
lines changed

src/main/java/io/appium/java_client/pagefactory/bys/builder/ByAll.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public WebElement findElement(SearchContext context) {
4545
return bys.stream()
4646
.map(by -> getSearchingFunction(by).apply(context))
4747
.filter(Optional::isPresent)
48-
.findFirst()
49-
.orElseThrow(() -> new NoSuchElementException("Cannot locate an element using " + toString()))
50-
.orElse(null);
48+
.findFirst().map(Optional::get)
49+
.orElseThrow(() -> new NoSuchElementException("Cannot locate an element using " + toString()));
5150
}
5251
}

0 commit comments

Comments
 (0)