diff --git a/src/browser/ScreenDprMonitor.ts b/src/browser/ScreenDprMonitor.ts index ec8c6d8a5d..27ae231f0b 100644 --- a/src/browser/ScreenDprMonitor.ts +++ b/src/browser/ScreenDprMonitor.ts @@ -44,12 +44,12 @@ export class ScreenDprMonitor extends Disposable { } private _updateDpr(): void { - if (!this._resolutionMediaMatchList || !this._outerListener) { + if (!this._outerListener) { return; } // Clear listeners for old DPR - this._resolutionMediaMatchList.removeListener(this._outerListener); + this._resolutionMediaMatchList?.removeListener(this._outerListener); // Add listeners for new DPR this._currentDevicePixelRatio = window.devicePixelRatio;