Skip to content

Commit

Permalink
fix(modal): add null check in focusOtherModal()
Browse files Browse the repository at this point in the history
closes  #2612
  • Loading branch information
IlyaSurmay authored and valorkin committed Oct 4, 2017
1 parent 1da7e15 commit e1f9b7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/modal/modal.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,8 @@ export class ModalDirective implements OnDestroy, OnInit {
// }

protected focusOtherModal() {
const otherOpenedModals = this._element.nativeElement.parentElement.querySelectorAll(
'.in[bsModal]'
);
if (this._element.nativeElement.parentElement == null) return;
const otherOpenedModals = this._element.nativeElement.parentElement.querySelectorAll('.in[bsModal]');
if (!otherOpenedModals.length) {
return;
}
Expand Down

0 comments on commit e1f9b7a

Please sign in to comment.