Skip to content

Commit

Permalink
fix: verify if breadcrumb array is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam committed Jul 20, 2020
1 parent f6350a4 commit 13f9151
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/xng-breadcrumb/src/lib/breadcrumb.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ export class BreadcrumbService {
private resolveQueryParamForLastItem(lastItem: Breadcrumb, activatedRoute: ActivatedRoute) {
const { queryParams, fragment } = activatedRoute.snapshot;
// For last item in the crumbs set queryParams from activatedRoute
lastItem.queryParams = Object.keys(queryParams).length > 0 ? { ...queryParams } : undefined
lastItem.fragment = fragment
if(lastItem){
lastItem.queryParams = Object.keys(queryParams).length > 0 ? { ...queryParams } : undefined;
lastItem.fragment = fragment
}
}

/**
Expand Down

0 comments on commit 13f9151

Please sign in to comment.