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 electronLog, { LogLevel, transports } from 'electron-log';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
@ -251,17 +251,7 @@ class Logger {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.loggerWindow) {
|
if (this.loggerWindow && !this.loggerWindow.isDestroyed()) {
|
||||||
const browserWindow = BrowserWindow.fromWebContents(this.loggerWindow);
|
|
||||||
if (
|
|
||||||
!(
|
|
||||||
!!browserWindow &&
|
|
||||||
typeof browserWindow.isDestroyed === 'function' &&
|
|
||||||
!browserWindow.isDestroyed()
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loggerWindow.send('log', {
|
this.loggerWindow.send('log', {
|
||||||
msgs: [logMsg],
|
msgs: [logMsg],
|
||||||
logLevel: this.desiredLogLevel,
|
logLevel: this.desiredLogLevel,
|
||||||
|
Loading…
Reference in New Issue
Block a user