We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Store.initRenderer()
1 parent 7e6fa09 commit a61f9eaCopy full SHA for a61f9ea
index.js
@@ -29,7 +29,13 @@ class ElectronStore extends Conf {
29
// If we are in the renderer process, we communicate with the main process
30
// to get the required data for the module otherwise, we pull from the main process.
31
if (ipcRenderer) {
32
- ({defaultCwd, appVersion} = ipcRenderer.sendSync('electron-store-get-data'));
+ const appData = ipcRenderer.sendSync('electron-store-get-data');
33
+
34
+ if (!appData) {
35
+ throw new Error('Electron Store: You need to call `.initRenderer()` from the main process.');
36
+ }
37
38
+ ({defaultCwd, appVersion} = appData);
39
} else if (ipcMain && app) {
40
({defaultCwd, appVersion} = initDataListener());
41
}
0 commit comments