title: TypeError: Cannot read property 'webContents' of null in Electron-dl
body: <p>I want to download the file and save it to the desired folder but every time I am getting the below error. </p>
  
  <h3>Main.js</h3>
  
  <pre><code>ipcMain.on('download-file', function (event, data) {
      console.log(data);
      download(BrowserWindow.getFocusedWindow(), data.url, {
          directory: "G:\\Orders\\"
      }).then(function (dl) {
          console.log(dl.getSavePath());
      }).catch(console.error);
  });
  </code></pre>
  
  <h3>Error</h3>
  
  <pre><code>TypeError: Cannot read property 'webContents' of null
      at Promise (G:\fc-electron\node_modules\electron-dl\index.js:125:22)
      at Promise (&lt;anonymous&gt;)
      at module.exports.download (G:\fc-electron\node_modules\electron-dl\index.js:122:47)
      at EventEmitter.&lt;anonymous&gt; (G:\fc-electron\main.js:53:9)
      at emitTwo (events.js:125:13)
      at EventEmitter.emit (events.js:213:7)
      at WebContents.&lt;anonymous&gt; (G:\fc-electron\node_modules\electron\dist\resources\electron.asar\browser\api\web-contents.js:249:13)
      at emitTwo (events.js:125:13)
      at WebContents.emit (events.js:213:7)
  </code></pre>
  
  <p>Any helpful answer will be appreciated.</p>