Skip to content

Commit febcaff

Browse files
mertdeg2andrewseguin
authored andcommitted
fix(overlay): _updateElementSize should not fail if pane is disposed. (#16600)
Note that this._pane will be set to null if the OverlayRef.dispose is called() This could happen due to variety of reasons. (cherry picked from commit a30270e)
1 parent 4a2ac08 commit febcaff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cdk/overlay/overlay-ref.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ export class OverlayRef implements PortalOutlet, OverlayReference {
359359

360360
/** Updates the size of the overlay element based on the overlay config. */
361361
private _updateElementSize() {
362+
if (!this._pane) {
363+
return;
364+
}
365+
362366
const style = this._pane.style;
363367

364368
style.width = coerceCssPixelValue(this._config.width);

0 commit comments

Comments
 (0)