Skip to content

Commit

Permalink
Merge pull request #623 from jeffu231/VIX-3598
Browse files Browse the repository at this point in the history
VIX-3598 Fix crash in setup of new DDP Controller
  • Loading branch information
jeffu231 authored Sep 19, 2024
2 parents 86794fd + 4733a97 commit 37f49aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Vixen.Modules/Controller/DDP/DDPData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DDPData : ModuleDataModelBase

public DDPData()
{
Address = "127, 0, 0, 1";
Address = IPAddress.Loopback.ToString();
}

public override IModuleDataModel Clone()
Expand Down
15 changes: 11 additions & 4 deletions src/Vixen.Modules/Controller/DDP/DDPSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ public DDPSetup(DDPData data)
InitializeComponent();
ForeColor = ThemeColorTable.ForeColor;
BackColor = ThemeColorTable.BackgroundColor;
ThemeUpdateControls.UpdateControls(this);
Address = IPAddress.Parse(data.Address);
ThemeUpdateControls.UpdateControls(this);
if (IPAddress.TryParse(data.Address, out var result))
{
Address = result;
}
else
{
Address = IPAddress.Loopback;
}
}

public IPAddress Address
Expand All @@ -25,12 +32,12 @@ public IPAddress Address
if (IPAddress.TryParse(textBoxIPAddress.Text, out result)) {
return result;
}
return null;
return IPAddress.Loopback;
}
set
{
if (value == null)
textBoxIPAddress.Text = string.Empty;
textBoxIPAddress.Text = IPAddress.Loopback.ToString();
else
textBoxIPAddress.Text = value.ToString();
}
Expand Down

0 comments on commit 37f49aa

Please sign in to comment.