Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d083f5af authored by Praveena Pachipulusu's avatar Praveena Pachipulusu Committed by Ricardo Cerqueira
Browse files

frameworks/base: Fix to avoid crash when the tab is not set from app

As the current tab is not set from application, getChildTabViewAt
returns Null value. Added a condition which checks whether mSelectTab
is set to first Tab.

(cherry picked from commit 9be6755efb149b22c36aa3eb7cc4ffe7e765e08a)

Change-Id: I11c77ca96333e2663d28db1b5fdb46602bd9e745
CRs-Fixed: 321176
parent 11f63ac8
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
            return;
        }

        if(mSelectedTab != -1) {
           final View selectedChild = getChildTabViewAt(mSelectedTab);

           final Drawable leftStrip = mLeftStrip;
@@ -353,6 +354,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
           leftStrip.draw(canvas);
           rightStrip.draw(canvas);
        }
    }

    /**
     * Sets the current tab.