[Bootstrap] Null-check argv
This commit is contained in:
parent
ed731b6153
commit
7688667bac
1 changed files with 3 additions and 3 deletions
6
src/bootstrap.js
vendored
6
src/bootstrap.js
vendored
|
@ -92,7 +92,7 @@ const startUpdate = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const startMin = process.argv.includes('--start-minimized');
|
const startMin = process.argv?.includes?.('--start-minimized');
|
||||||
|
|
||||||
if (updater.tryInitUpdater(buildInfo, Constants.NEW_UPDATE_ENDPOINT)) {
|
if (updater.tryInitUpdater(buildInfo, Constants.NEW_UPDATE_ENDPOINT)) {
|
||||||
const inst = updater.getUpdater();
|
const inst = updater.getUpdater();
|
||||||
|
@ -120,7 +120,7 @@ const startUpdate = () => {
|
||||||
|
|
||||||
setTimeout(() => { // Try to update our asar
|
setTimeout(() => { // Try to update our asar
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
if (oaConfig.setup !== true || process.argv.includes('--config')) config.open();
|
if (oaConfig.setup !== true) config.open();
|
||||||
|
|
||||||
if (oaConfig.autoupdate !== false) { // If autoupdate disabled, don't update
|
if (oaConfig.autoupdate !== false) { // If autoupdate disabled, don't update
|
||||||
try {
|
try {
|
||||||
|
@ -141,7 +141,7 @@ module.exports = () => {
|
||||||
desktopCore?.handleOpenUrl?.(a.includes('--url') && a[a.indexOf('--') + 1]); // Change url of main window if protocol is used (uses like "discord --url -- discord://example")
|
desktopCore?.handleOpenUrl?.(a.includes('--url') && a[a.indexOf('--') + 1]); // Change url of main window if protocol is used (uses like "discord --url -- discord://example")
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!app.requestSingleInstanceLock() && !(process.argv.includes('--multi-instance') || oaConfig.multiInstance === true)) return app.quit();
|
if (!app.requestSingleInstanceLock() && !(process.argv?.includes?.('--multi-instance') || oaConfig.multiInstance === true)) return app.quit();
|
||||||
|
|
||||||
if (app.isReady()) startUpdate();
|
if (app.isReady()) startUpdate();
|
||||||
else app.once('ready', startUpdate);
|
else app.once('ready', startUpdate);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue