Skip to content

Commit d404dff

Browse files
committed
fix(bottom-navigation): more safeguard for android system theme change
1 parent cef458e commit d404dff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bottom-navigation/index.android.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,14 +821,19 @@ export class BottomNavigation extends TabNavigationBase {
821821
}
822822

823823
public updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec) {
824-
this._bottomNavigationBar.updateItemAt(index, spec);
824+
if (this._bottomNavigationBar) {
825+
this._bottomNavigationBar.updateItemAt(index, spec);
826+
}
825827
}
826828

827829
public getTabBarBackgroundColor(): android.graphics.drawable.Drawable {
828830
return this._bottomNavigationBar.getBackground();
829831
}
830832

831833
public setTabBarBackgroundColor(value: android.graphics.drawable.Drawable | Color): void {
834+
if (!this._bottomNavigationBar) {
835+
return;
836+
}
832837
if (value instanceof Color) {
833838
this._bottomNavigationBar.setBackgroundColor(value.android);
834839
} else {

0 commit comments

Comments
 (0)