From 333242088680923b4aff0ade3d64b1ebc590dde4 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 25 Oct 2021 17:10:33 +0200 Subject: [PATCH] docs: win.getParentWindow() returns BrowserWindow | null (#31548) --- docs/api/browser-window.md | 2 +- spec-main/api-browser-window-spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index c9f4f08119b6..776e8e5d3017 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1697,7 +1697,7 @@ current window into a top-level window. #### `win.getParentWindow()` -Returns `BrowserWindow` - The parent window. +Returns `BrowserWindow | null` - The parent window or `null` if there is no parent. #### `win.getChildWindows()` diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index 686344d9d891..26f89f28f30b 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -3485,7 +3485,7 @@ describe('BrowserWindow module', () => { const w = new BrowserWindow({ show: false }); const c = new BrowserWindow({ show: false, parent: w }); expect(c.isVisible()).to.be.false('child is visible'); - expect(c.getParentWindow().isVisible()).to.be.false('parent is visible'); + expect(c.getParentWindow()!.isVisible()).to.be.false('parent is visible'); }); });