Skip to content

Commit 4c226ef

Browse files
committed
fix(bottomnavigationbar): android NPE fix
1 parent a9bd499 commit 4c226ef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/core/platforms/android/java/com/nativescript/material/core/BottomNavigationBar.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ public void setItems(TabItemSpec[] items) {
119119
*/
120120
public void updateItemAt(int position, TabItemSpec tabItem) {
121121
LinearLayout ll = (LinearLayout)mTabStrip.getChildAt(position);
122-
ImageView imgView = (ImageView)ll.getChildAt(0);
123-
TextView textView = (TextView)ll.getChildAt(1);
124-
this.setupItem(ll, textView, imgView, tabItem);
122+
if (ll != null) {
123+
ImageView imgView = (ImageView)ll.getChildAt(0);
124+
TextView textView = (TextView)ll.getChildAt(1);
125+
this.setupItem(ll, textView, imgView, tabItem);
126+
}
125127
}
126128

127129
/**

0 commit comments

Comments
 (0)