From 14f20d01aa7ed5f128a9e8cacfb0f7abe63829c1 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Thu, 13 Aug 2015 09:51:25 -0400 Subject: [PATCH 1/2] Fix closeTab crash 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. --- .../src/main/java/com/linkbubble/MainController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java b/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java index 04862c50c..42da78039 100644 --- a/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java +++ b/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java @@ -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) { From 50fe9216dd999cea4f68330836e735c65309feff Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Thu, 13 Aug 2015 09:53:58 -0400 Subject: [PATCH 2/2] Add to changelog for top crashers --- .../LinkBubble/src/main/java/com/linkbubble/MainController.java | 1 + Application/LinkBubble/src/main/res/xml/changelog.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java b/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java index 42da78039..aeb0ad5f1 100644 --- a/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java +++ b/Application/LinkBubble/src/main/java/com/linkbubble/MainController.java @@ -915,6 +915,7 @@ public boolean closeTab(TabView tabView, boolean animateOff, boolean canShowUndo public boolean closeTab(TabView tabView, Constant.BubbleAction action, boolean animateOff, boolean canShowUndoPrompt) { if (tabView == null) { + CrashTracking.log("closeTab attempt on null tabView"); return false; } diff --git a/Application/LinkBubble/src/main/res/xml/changelog.xml b/Application/LinkBubble/src/main/res/xml/changelog.xml index 83a075543..295f74d93 100755 --- a/Application/LinkBubble/src/main/res/xml/changelog.xml +++ b/Application/LinkBubble/src/main/res/xml/changelog.xml @@ -6,6 +6,7 @@ NEW: Ability to upload files via HTML file picker inputs. This requires us to ask for the permissions to read from external storage. BUG FIX: Fixed text color for light colored theme backgrounds. BUG FIX: Fixed previously broken functionality with various websites and image galleries. + BUG FIX: Fixed top crashers.