From 90bff4d9de42cdb94894daf93d30b0749ba8acd4 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Fri, 16 Sep 2016 11:43:48 -0700 Subject: [PATCH] :wrench: Ensure correct types for commandLine This commit ensures that arguments passed to `appendSwitch` and `appendArgument` are turned into strings before passing them over to the binding. --- lib/browser/api/app.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/browser/api/app.js b/lib/browser/api/app.js index c6ad57321baa..a3d227b07961 100644 --- a/lib/browser/api/app.js +++ b/lib/browser/api/app.js @@ -24,8 +24,20 @@ Object.assign(app, { return Menu.getApplicationMenu() }, commandLine: { - appendSwitch: bindings.appendSwitch, - appendArgument: bindings.appendArgument + appendSwitch() { + let castedArgs = [...arguments].map((arg) => { + return typeof arg !== 'string' ? `${arg}` : arg + }) + + return binding.appendSwitch(...castedArgs) + }, + appendArgument() { + let castedArgs = [...arguments].map((arg) => { + return typeof arg !== 'string' ? `${arg}` : arg + }) + + return binding.appendArgument(...castedArgs) + } } })