Skip to content

Commit

Permalink
fix(electron): Check whether the splash screen is already destroyed o…
Browse files Browse the repository at this point in the history
…n close (#2044)
  • Loading branch information
walkingriver authored and jcesarmobile committed Oct 17, 2019
1 parent 667c331 commit 455c6e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ class CapacitorSplashScreen {
`;

this.mainWindowRef.on('closed', () => {
this.splashWindow.close();
if (this.splashWindow && !this.splashWindow.isDestroyed()) {
this.splashWindow.close();
}
});

this.splashWindow.loadURL(`data:text/html;charset=UTF-8,${splashHtml}`, {baseURLForDataURL: `file://${rootPath}/splash_assets/`});
Expand Down

0 comments on commit 455c6e9

Please sign in to comment.