mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
fix: second argument to shell.writeShortcutLink is optional (#49503)
fix: second argument to shell.writeShortcutLink is optional Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user