Skip to content

Commit

Permalink
fix(lib): prevent TypeError "Cannot read property 'getActiveChildNavs…
Browse files Browse the repository at this point in the history
…' of undefined" (#323)
  • Loading branch information
ChrizC authored and danielsogl committed Aug 24, 2018
1 parent 742130c commit a0c8496
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/super-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ export class SuperTabs implements OnInit, AfterContentInit, AfterViewInit, OnDes
}

getActiveChildNavs(): NavigationContainer[] {
if (this.selectedTabIndex < 0) {
this.selectedTabIndex = 0;
}

return [this._tabs[this.selectedTabIndex]];
}

Expand Down

3 comments on commit a0c8496

@heidji
Copy link

@heidji heidji commented on a0c8496 Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't fix anything

@ChrizC
Copy link
Contributor Author

@ChrizC ChrizC commented on a0c8496 Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heidji a new version of the plugin hasn't been released with this fix yet. I've been trying to get them to publish one but they won't. Seems they're not fussed on fixing their stuff.

@heidji
Copy link

@heidji heidji commented on a0c8496 Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i copied the rep into my project because i made major changes in it, such as the ability to post notification count to tabs and such. i only copied your change here into my rep and i'm still getting an error.
it makes sense to me because the error says 'nav' is not defined on nav.getActiveChildNavs, so what you did here is make sure that the function returns something. but what if the function isn't called at all? that is the error!

Please sign in to comment.