Fix initialization of registry input

dhcp-server
Pat Hartl 2023-08-02 18:36:53 -05:00
parent d4affbc680
commit fef2171588
1 changed files with 9 additions and 1 deletions

View File

@ -29,7 +29,15 @@
protected override async Task OnInitializedAsync()
{
Hive = AvailableHives.FirstOrDefault(h => Value != null && Value.StartsWith(h));
if (Hive == null)
Hive = "HKCU:\\";
if (Value == null)
Value = Hive;
if (!String.IsNullOrWhiteSpace(Value))
Hive = AvailableHives.FirstOrDefault(h => Value != null && Value.StartsWith(h));
Path = Value.Substring(Hive.Length);
}