Skip to content

Commit

Permalink
Fix primefaces#2412: BlockUI NPE with 0s animation as mask might not …
Browse files Browse the repository at this point in the history
…be created yet
  • Loading branch information
melloware committed Nov 11, 2021
1 parent 77b1ce4 commit 1037769
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/blockui/BlockUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ export class BlockUI extends Component {
}

unblock() {
if (!this.mask) {
this.setState({ visible: false }, () => {
this.props.fullScreen && DomHandler.removeClass(document.body, 'p-overflow-hidden');
this.props.onUnblocked && this.props.onUnblocked();
});
return;
}

DomHandler.addClass(this.mask, 'p-component-overlay-leave');
this.mask.addEventListener('animationend', () => {
ZIndexUtils.clear(this.mask);
Expand Down

0 comments on commit 1037769

Please sign in to comment.