Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 30, 2024
1 parent 79085af commit 9fdf6c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private async Task SaveServerAsync()
_noticeHandler?.Enqueue(ResUI.FillServerAddressCustom);
return;
}
SelectedSource.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);
SelectedSource.coreType = CoreType.IsNullOrEmpty() ? null : (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);

if (ConfigHandler.EditCustomServer(_config, SelectedSource) == 0)
{
Expand Down
3 changes: 2 additions & 1 deletion v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class AddServerViewModel : MyReactiveObject
{
[Reactive]
public ProfileItem SelectedSource { get; set; }

[Reactive]
public string? CoreType { get; set; }

Expand Down Expand Up @@ -82,7 +83,7 @@ private async Task SaveServerAsync()
return;
}
}
SelectedSource.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);
SelectedSource.coreType = CoreType.IsNullOrEmpty() ? null : (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);

if (ConfigHandler.AddServer(_config, SelectedSource) == 0)
{
Expand Down

0 comments on commit 9fdf6c6

Please sign in to comment.