Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
Fix closeTab crash
Browse files Browse the repository at this point in the history
This is the top crash in fabric here:
https://fabric.io/brave6/android/apps/com.linkbubble.playstore/issues/55c93db6e0d514e5d6e4b8ce

For wahtever reason the view is sometimes null when closing a tab. This
just checks to make sure it's not null.  Some of the checks that call
into closeTab already did null checks, the one that was crashing did
not. I thought it was better to just have the check inside the function.
  • Loading branch information
bbondy committed Aug 13, 2015
1 parent 6020fdf commit 14f20d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ public boolean closeTab(TabView tabView, boolean animateOff, boolean canShowUndo

public boolean closeTab(TabView tabView, Constant.BubbleAction action, boolean animateOff, boolean canShowUndoPrompt) {

if (tabView == null) {
return false;
}

// If the tab is already closing, do nothing. Otherwise we could end up in a weird state,
// where we attempt to show multiple prompts and crashing upon tab restore.
if (tabView.mIsClosing == true) {
Expand Down

0 comments on commit 14f20d0

Please sign in to comment.