jenkins-bot has submitted this change and it was merged.

Change subject: Fix possible crash when closing tabs.
......................................................................


Fix possible crash when closing tabs.

This protects against a possible IndexOutOfBounds exception when closing a
tab. Even though I haven't been able to reproduce it, a few users have
reported it when "closing tabs quickly."

Bug: T109998
Change-Id: Ia9938506fe9c8f97f4ac3803541bdb68639f3fd6
---
M app/src/main/java/org/wikipedia/page/PageFragment.java
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Sniedzielski: Looks good to me, approved
  Niedzielski: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java 
b/app/src/main/java/org/wikipedia/page/PageFragment.java
index fdbde74..2527d81 100755
--- a/app/src/main/java/org/wikipedia/page/PageFragment.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragment.java
@@ -446,6 +446,12 @@
 
         @Override
         public void onCloseTabRequested(int position) {
+            if (!app.isDevRelease() && (position < 0 || position >= 
tabList.size())) {
+                // According to T109998, the position may possibly be 
out-of-bounds, but we can't
+                // reproduce it. We'll handle this case, but only for non-dev 
builds, so that we
+                // can investigate the issue further if we happen upon it 
ourselves.
+                return;
+            }
             tabList.remove(position);
             tabFunnel.logClose(tabList.size(), position);
             if (position < tabList.size()) {

-- 
To view, visit https://gerrit.wikimedia.org/r/233949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9938506fe9c8f97f4ac3803541bdb68639f3fd6
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to