Skip to content

Commit 73ad349

Browse files
committed
fix(tabs): android prevent crash on css theme change
1 parent 13c7479 commit 73ad349

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tabs/tabs.android.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,10 @@ export class Tabs extends TabsBase {
847847
// }
848848

849849
public updateAndroidItemAt(index: number, spec: com.nativescript.material.core.TabItemSpec) {
850-
this._tabsBar.updateItemAt(index, spec);
850+
// that try catch is fix for an android NPE error on css change which navigated in (not the current fragment)
851+
try {
852+
this._tabsBar.updateItemAt(index, spec);
853+
} catch (err) {}
851854
}
852855

853856
public getTabBarBackgroundColor(): android.graphics.drawable.Drawable {

0 commit comments

Comments
 (0)