Skip to content

Commit 4511c76

Browse files
authored
fix(tabs-ios): crash when setting tabStripItems through items property (#7548)
1 parent 46c17ca commit 4511c76

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎tns-core-modules/ui/tabs/tabs.ios.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,11 @@ export class Tabs extends TabsBase {
590590

591591
this._ios.dataSource = this._dataSource;
592592
this._ios.delegate = this._delegate;
593+
594+
if (!this.tabBarItems) {
595+
const tabStripItems = this.tabStrip ? this.tabStrip.items : null;
596+
this.setTabStripItems(tabStripItems);
597+
}
593598
}
594599

595600
public onUnloaded() {
@@ -836,6 +841,10 @@ export class Tabs extends TabsBase {
836841
}
837842

838843
public setTabStripItems(items: Array<TabStripItem>) {
844+
if (!this.tabStrip || !items) {
845+
return;
846+
}
847+
839848
const tabBarItems = [];
840849

841850
items.forEach((item: TabStripItem, i) => {

0 commit comments

Comments
 (0)