From 0c18042ca83cc27f93db27e8e56897040d5aebab Mon Sep 17 00:00:00 2001 From: ADjenkov Date: Fri, 19 Jul 2019 11:14:32 +0300 Subject: [PATCH] fix(tabs-ios): crash when setting tabStripItems through items property --- tns-core-modules/ui/tabs/tabs.ios.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tns-core-modules/ui/tabs/tabs.ios.ts b/tns-core-modules/ui/tabs/tabs.ios.ts index 979d93e41b..9239454ac6 100644 --- a/tns-core-modules/ui/tabs/tabs.ios.ts +++ b/tns-core-modules/ui/tabs/tabs.ios.ts @@ -590,6 +590,11 @@ export class Tabs extends TabsBase { this._ios.dataSource = this._dataSource; this._ios.delegate = this._delegate; + + if (!this.tabBarItems) { + const tabStripItems = this.tabStrip ? this.tabStrip.items : null; + this.setTabStripItems(tabStripItems); + } } public onUnloaded() { @@ -836,6 +841,10 @@ export class Tabs extends TabsBase { } public setTabStripItems(items: Array) { + if (!this.tabStrip || !items) { + return; + } + const tabBarItems = []; items.forEach((item: TabStripItem, i) => {