pull/5580/head
2dust 2024-08-21 21:12:01 +08:00
parent 9d49c7aad0
commit 064431421a
3 changed files with 4 additions and 4 deletions

View File

@ -165,7 +165,7 @@ namespace ServiceLib.ViewModels
{
return;
}
foreach (var it in SelectedSources)
foreach (var it in SelectedSources ?? [SelectedSource])
{
var item = _rules.FirstOrDefault(t => t.id == it?.id);
if (item != null)
@ -186,7 +186,7 @@ namespace ServiceLib.ViewModels
}
var lst = new List<RulesItem4Ray>();
foreach (var it in SelectedSources)
foreach (var it in SelectedSources ?? [SelectedSource])
{
var item = _rules.FirstOrDefault(t => t.id == it?.id);
if (item != null)

View File

@ -256,7 +256,7 @@ namespace ServiceLib.ViewModels
{
return;
}
foreach (var it in SelectedSources)
foreach (var it in SelectedSources ?? [SelectedSource])
{
var item = LazyConfig.Instance.GetRoutingItem(it?.id);
if (item != null)

View File

@ -90,7 +90,7 @@ namespace ServiceLib.ViewModels
return;
}
foreach (var it in SelectedSources)
foreach (var it in SelectedSources ?? [SelectedSource])
{
ConfigHandler.DeleteSubItem(_config, it.id);
}