Skip to content

Commit

Permalink
fix(modal): check modal body exists before accessing attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
exp625 authored and kevinbuhmann committed Nov 14, 2022
1 parent 15caf8e commit 3886a50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/angular/src/modal/modal-body.ts
Expand Up @@ -59,7 +59,7 @@ export class ClrModalBody implements OnDestroy {
private addOrRemoveTabIndex() {
const modalBody = this.host.nativeElement.parentElement;

if (modalBody.clientHeight < modalBody.scrollHeight) {
if (modalBody && modalBody.clientHeight < modalBody.scrollHeight) {
this.addTabIndex();
} else {
this.removeTabIndex();
Expand Down

0 comments on commit 3886a50

Please sign in to comment.