mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-3430 - Add safety check for logger window (#1286)
This commit is contained in:
parent
349fa2c1bb
commit
bc9b6cf8ce
@ -1,4 +1,4 @@
|
||||
import { app, BrowserWindow } from 'electron';
|
||||
import { app } from 'electron';
|
||||
import electronLog, { LogLevel, transports } from 'electron-log';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
@ -251,17 +251,7 @@ class Logger {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.loggerWindow) {
|
||||
const browserWindow = BrowserWindow.fromWebContents(this.loggerWindow);
|
||||
if (
|
||||
!(
|
||||
!!browserWindow &&
|
||||
typeof browserWindow.isDestroyed === 'function' &&
|
||||
!browserWindow.isDestroyed()
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (this.loggerWindow && !this.loggerWindow.isDestroyed()) {
|
||||
this.loggerWindow.send('log', {
|
||||
msgs: [logMsg],
|
||||
logLevel: this.desiredLogLevel,
|
||||
|
Loading…
Reference in New Issue
Block a user