yafp / media-dupes

a minimal content duplicator for common media services like youtube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Cannot read property 'webContents' of null

yafp opened this issue · comments

commented

via sentry: MEDIA-DUPES-JB - https://sentry.io/organizations/yafp/issues/1581597457/

TypeError PowerMonitor.(main)
fatalCannot read property 'webContents' of null

...

app:///main.js in PowerMonitor. at line 896:20

    */
    function powerMonitorInit () {
        const { powerMonitor } = require('electron') // This module cannot be used until the ready event of the app module is emitted.
        // suspend
        powerMonitor.on('suspend', () => {
            doLog('warn', 'powerMonitorInit ::: The system is going to sleep (event: suspend)')
            mainWindow.webContents.send('todoListTryToSave') // try to save the todolist - see #79
            powerMonitorNotify('warning', 'The system is going to sleep (event: suspend)', 0)
        })
        // resume
        powerMonitor.on('resume', () => {
            doLog('info', 'powerMonitorInit ::: The system is resuming (event: resume)')
            mainWindow.webContents.send('todoListCheck') // search if there are urls to restore