Skip to content

Commit

Permalink
fix(core/modal-header): prevent npe
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiashader committed Oct 31, 2023
1 parent 9ff270f commit 28da016
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/core/src/components/modal-header/modal-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export class ModalHeader {
@Prop() icon: string;
@Watch('icon')
onIconChange(icon: string) {
if (icon) {
this.parentDialog.classList.add('with-icon');
} else {
this.parentDialog.classList.remove('with-icon');
if (this.parentDialog) {
if (icon) {
this.parentDialog.classList.add('with-icon');
} else {
this.parentDialog.classList.remove('with-icon');
}
}
}

Expand Down

0 comments on commit 28da016

Please sign in to comment.