Browse Source

docs: win.getParentWindow() returns BrowserWindow | null (#31548)

Milan Burda 3 years ago
parent
commit
3332420886
2 changed files with 2 additions and 2 deletions
  1. 1 1
      docs/api/browser-window.md
  2. 1 1
      spec-main/api-browser-window-spec.ts

+ 1 - 1
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()`
 

+ 1 - 1
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');
       });
     });