Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 446f824

Browse files
keianhzobluemarvin
authored andcommitted
Focus window can handle null windows. Revert the null check (#2666)
1 parent 5b6c98e commit 446f824

File tree

1 file changed

+3
-8
lines changed
  • app/src/common/shared/org/mozilla/vrbrowser/ui/widgets

1 file changed

+3
-8
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public void moveWindowLeft(@NonNull WindowWidget aWindow) {
383383
}
384384
}
385385

386-
public void focusWindow(@NonNull WindowWidget aWindow) {
386+
public void focusWindow(@Nullable WindowWidget aWindow) {
387387
if (aWindow != mFocusedWindow) {
388388
WindowWidget prev = mFocusedWindow;
389389
mFocusedWindow = aWindow;
@@ -518,15 +518,10 @@ public void enterPrivateMode() {
518518

519519
if (mPrivateWindows.size() == 0) {
520520
WindowWidget window = addWindow();
521-
if (window != null) {
522-
window.loadHome();
523-
}
521+
window.loadHome();
524522

525523
} else {
526-
WindowWidget window = getWindowWithPlacement(mRegularWindowPlacement);
527-
if (window != null) {
528-
focusWindow(window);
529-
}
524+
focusWindow(getWindowWithPlacement(mPrivateWindowPlacement));
530525
}
531526
updateViews();
532527
mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);

0 commit comments

Comments
 (0)