fix(desktop): guard destroyed recovery windows (#37406)

This commit is contained in:
Luke Parker
2026-07-17 11:22:18 +10:00
committed by GitHub
parent 08fb473735
commit 4436678f7d
4 changed files with 38 additions and 11 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import type { BrowserWindow } from "electron"
import { write as writeLog } from "./logging"
import { safeWindowURL } from "./window-state"
const sampleInterval = 1000
const samplePeriod = 15000
@@ -46,7 +47,7 @@ export function createUnresponsiveSampler(win: BrowserWindow, name: string) {
const message = [
"renderer unresponsive samples",
`Window: ${name}`,
`URL: ${win.isDestroyed() ? "<destroyed>" : win.webContents.getURL()}`,
`URL: ${safeWindowURL(win)}`,
...entries.map((entry) => `<${entry[1]}> ${entry[0]}`),
`Total Samples: ${total}`,
].join("\n")