From 964934c16122767e3554e372126fb7def0243c1c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 21 Apr 2023 19:13:59 +0200 Subject: [PATCH] fix: defaults broken in shell.openExternal() options (#38038) Co-authored-by: Milan Burda --- shell/common/api/electron_api_shell.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/shell/common/api/electron_api_shell.cc b/shell/common/api/electron_api_shell.cc index 0039b9596188..1055cb73d402 100644 --- a/shell/common/api/electron_api_shell.cc +++ b/shell/common/api/electron_api_shell.cc @@ -59,13 +59,11 @@ v8::Local OpenExternal(const GURL& url, gin::Arguments* args) { v8::Local handle = promise.GetHandle(); platform_util::OpenExternalOptions options; - if (args->Length() >= 2) { - gin::Dictionary obj(nullptr); - if (args->GetNext(&obj)) { - obj.Get("activate", &options.activate); - obj.Get("workingDirectory", &options.working_dir); - obj.Get("logUsage", &options.log_usage); - } + gin_helper::Dictionary obj; + if (args->GetNext(&obj)) { + obj.Get("activate", &options.activate); + obj.Get("workingDirectory", &options.working_dir); + obj.Get("logUsage", &options.log_usage); } platform_util::OpenExternal(