fix: second argument to shell.writeShortcutLink is optional (#49476)

fix: second argument to shell.writeShortcutLink is optional
This commit is contained in:
Shelley Vohr
2026-01-23 17:24:47 +01:00
committed by GitHub
parent 8c5c6a6088
commit 89963618d9
2 changed files with 24 additions and 5 deletions

View File

@@ -112,11 +112,20 @@ bool WriteShortcutLink(const base::FilePath& shortcut_path,
gin::Arguments* const args) {
base::win::ShortcutOperation operation =
base::win::ShortcutOperation::kCreateAlways;
args->GetNext(&operation);
auto options = gin::Dictionary::CreateEmpty(args->isolate());
if (!args->GetNext(&options)) {
args->ThrowError();
return false;
gin::Dictionary options = gin::Dictionary::CreateEmpty(args->isolate());
v8::Local<v8::Value> peek = args->PeekNext();
if (peek->IsObject()) {
if (!args->GetNext(&options)) {
args->ThrowError();
return false;
}
} else {
args->GetNext(&operation);
if (!args->GetNext(&options)) {
args->ThrowError();
return false;
}
}
base::win::ShortcutProperties properties;