Skip to content

Commit

Permalink
Fixed #10719 issue where error is thrown when the label is set to an …
Browse files Browse the repository at this point in the history
…async pipe value
  • Loading branch information
Andrew McClellan committed Oct 7, 2021
1 parent 56075a2 commit 38d5bf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {
DomHandler.addClass(iconElement, iconPosClass);
}

DomHandler.addMultipleClasses(iconElement, this.getIconClass());
let iconClass = this.getIconClass();
if(iconClass) {
DomHandler.addMultipleClasses(iconElement, iconClass);
}
let labelEl = DomHandler.findSingle(this.el.nativeElement, '.p-button-label')

if (labelEl)
Expand Down

0 comments on commit 38d5bf0

Please sign in to comment.