Merge pull request #3772 from Kingtous/master

fix: shortcut not working due to range error
This commit is contained in:
RustDesk 2023-03-25 11:20:57 +08:00 committed by GitHub
commit ab4c6e24f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -1522,14 +1522,14 @@ bool checkArguments() {
return false;
}
String? id =
kBootArgs.length < connectIndex + 1 ? null : kBootArgs[connectIndex + 1];
kBootArgs.length <= connectIndex + 1 ? null : kBootArgs[connectIndex + 1];
String? password =
kBootArgs.length < connectIndex + 2 ? null : kBootArgs[connectIndex + 2];
kBootArgs.length <= connectIndex + 2 ? null : kBootArgs[connectIndex + 2];
if (password != null && password.startsWith("--")) {
password = null;
}
final switchUuidIndex = kBootArgs.indexOf("--switch_uuid");
String? switchUuid = kBootArgs.length < switchUuidIndex + 1
String? switchUuid = kBootArgs.length <= switchUuidIndex + 1
? null
: kBootArgs[switchUuidIndex + 1];
if (id != null) {

View File

@ -134,10 +134,9 @@ void runMainApp(bool startService) async {
await restoreWindowPosition(WindowType.Main);
// Check the startup argument, if we successfully handle the argument, we keep the main window hidden.
final handledByUniLinks = await initUniLinks();
final handledByCli = checkArguments();
debugPrint(
"handled by uni links: $handledByUniLinks, handled by cli: $handledByCli");
if (handledByUniLinks || handledByCli) {
"handled by uni links: $handledByUniLinks");
if (handledByUniLinks || checkArguments()) {
windowManager.hide();
} else {
windowManager.show();