Skip to content

Commit 6e03da6

Browse files
committed
frontend/launcher: don't pass spurious space chars when bypassing update check.
The previous code kind of assumed that the additional launcher arguments are non-empty and added a space character unconditionally after them, right before a potential launcher argument that skips update checks (currently only available/implemented for Epic/Legendary). While technically a stray space character should be harmless (assuming that the passed string is afterwards handled with shlex.split() and turned into an array), it's still a good idea to try to prevent future bugs.
1 parent 569ab5f commit 6e03da6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/frontend/helpers/library.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,18 @@ const launch = async ({
174174
if (hasUpdate) {
175175
const { ignoreGameUpdates } = await window.api.requestGameSettings(appName)
176176

177+
const launchArgsSkipUpdate: string[] = []
178+
if (launchArguments) {
179+
launchArgsSkipUpdate.push(launchArguments)
180+
}
181+
if (runner === 'legendary') launchArgsSkipUpdate.push('--skip-version-check')
182+
177183
if (ignoreGameUpdates) {
178184
return window.api.launch({
179185
appName,
180186
runner,
181187
launchArguments:
182-
launchArguments +
183-
' ' +
184-
(runner === 'legendary' ? '--skip-version-check' : '')
188+
launchArgsSkipUpdate.join(' ')
185189
})
186190
}
187191

@@ -211,9 +215,7 @@ const launch = async ({
211215
appName,
212216
runner,
213217
launchArguments:
214-
launchArguments +
215-
' ' +
216-
(runner === 'legendary' ? '--skip-version-check' : '')
218+
launchArgsSkipUpdate.join(' ')
217219
})
218220
)
219221
}

0 commit comments

Comments
 (0)