Actually there is no need to use flatMap
`null` values returned in the lambda are converted to empty `Optional`s in the `map` method: https://developer.android.com/reference/java/util/Optional#map(java.util.function.Function%3C?%20super%20T,%20?%20extends%20U%3E)
This commit is contained in:
parent
0f0a1d36d8
commit
b6b09b68af
3 changed files with 5 additions and 4 deletions
|
|
@ -1887,7 +1887,7 @@ public final class VideoDetailFragment
|
|||
setupBrightness();
|
||||
if (!isPlayerAndPlayerServiceAvailable()
|
||||
|| player.UIs().get(MainPlayerUi.class).isEmpty()
|
||||
|| getRoot().flatMap(v -> Optional.ofNullable(v.getParent())).isEmpty()) {
|
||||
|| getRoot().map(View::getParent).isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue