fix build

This commit is contained in:
Benjamin Pasero 2020-11-10 08:17:14 +01:00
parent 6c32ada9b5
commit 65f805d98e
4 changed files with 9 additions and 5 deletions

View file

@ -29,7 +29,7 @@ if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
}
// Pseudo NLS support
if (nlsConfig?.pseudo) {
if (nlsConfig && nlsConfig.pseudo) {
loader(['vs/nls'], function (nlsPlugin) {
nlsPlugin.setPseudoTranslation(nlsConfig.pseudo);
});

View file

@ -81,7 +81,9 @@ function pipeLoggingToParent() {
// to start the stacktrace where the console message was being written
if (process.env.VSCODE_LOG_STACK === 'true') {
const stack = new Error().stack;
argsArray.push({ __$stack: stack?.split('\n').slice(3).join('\n') });
if (stack) {
argsArray.push({ __$stack: stack.split('\n').slice(3).join('\n') });
}
}
try {
@ -114,7 +116,9 @@ function pipeLoggingToParent() {
*/
function safeSend(arg) {
try {
process.send?.(arg);
if (process.send) {
process.send(arg);
}
} catch (error) {
// Can happen if the parent channel is closed meanwhile
}

View file

@ -61,7 +61,7 @@
const enableDeveloperTools = (safeProcess.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath) && !configuration.extensionTestsPath;
let developerToolsUnbind;
if (enableDeveloperTools || (options && options.forceEnableDeveloperKeybindings)) {
developerToolsUnbind = registerDeveloperKeybindings(options?.disallowReloadKeybinding);
developerToolsUnbind = registerDeveloperKeybindings(options && options.disallowReloadKeybinding);
}
// Correctly inherit the parent's environment (TODO@sandbox non-sandboxed only)

View file

@ -107,7 +107,7 @@ crashReporter.start({
// to ensure that no 'logs' folder is created on disk at a
// location outside of the portable directory
// (https://github.com/microsoft/vscode/issues/56651)
if (portable?.isPortable) {
if (portable && portable.isPortable) {
app.setAppLogsPath(path.join(userDataPath, 'logs'));
}