From 2caf8ea14ffef15e12463b8bf8b524466b09db7e Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:49:37 +0800 Subject: [PATCH] Bug fix https://github.com/2dust/v2rayN/issues/9016 --- .../ServiceLib/ViewModels/ProfilesViewModel.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 6e7e183c..7a127fa7 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -709,18 +709,22 @@ public class ProfilesViewModel : MyReactiveObject public async Task ServerSpeedtest(ESpeedActionType actionType) { - if (actionType == ESpeedActionType.Mixedtest) + List? lstSelected; + if (actionType is ESpeedActionType.Mixedtest or ESpeedActionType.FastRealping) { - SelectedProfiles = ProfileItems; + if (actionType == ESpeedActionType.FastRealping) + { + actionType = ESpeedActionType.Realping; + } + + lstSelected = JsonUtils.Deserialize>(JsonUtils.Serialize(ProfileItems?.OrderBy(t => t.Sort))); } - else if (actionType == ESpeedActionType.FastRealping) + else { - SelectedProfiles = ProfileItems; - actionType = ESpeedActionType.Realping; + lstSelected = await GetProfileItems(false); } - var lstSelected = await GetProfileItems(false); - if (lstSelected == null) + if (lstSelected is null || lstSelected.Count <= 0) { return; }