添加option的空值校验

This commit is contained in:
fofolee 2025-04-23 18:58:04 +08:00
parent 14769bb7e7
commit 3d2d15e177
2 changed files with 6 additions and 6 deletions

View File

@ -173,10 +173,10 @@ export default defineComponent({
} else {
let option =
command.program === "custom"
? command.customOptions
: this.programs[command.program];
option.scptarg = command.scptarg;
option.charset = command.charset;
? command.customOptions || {}
: this.programs[command.program] || {};
option.scptarg = command.scptarg || "";
option.charset = command.charset || {};
window.runCodeFile(
commandCode,
option,

View File

@ -170,8 +170,8 @@ export default {
getCommandOpt(command) {
let option =
command.program === "custom"
? command.customOptions
: programs[command.program];
? command.customOptions || {}
: programs[command.program] || {};
option.scptarg = command.scptarg || "";
option.charset = command.charset || {};
option.envPath = this.$root.nativeProfile.envPath.trim() || "";