Skip to content

Commit 564a00a

Browse files
committed
Fix bug where Webservices Mod would fail if applied after resetting
1 parent fa43aa2 commit 564a00a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ZuneModCore/Mods/WebservicesMod.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class WebservicesMod : Mod
2121
private const string WEBSERVICE_SUBTITLE_SUCCESS = "OK";
2222
private const string WEBSERVICE_SUBTITLE_UNREACHABLE = "Unreachable";
2323

24-
private readonly HttpClient _client = new();
24+
private HttpClient _client;
2525
private CancellationTokenSource _cts = new();
2626

2727
public override string Id => nameof(WebservicesMod);
@@ -79,7 +79,10 @@ private static AbstractUIMetadata GetWebserviceAvailabilityUI(string name, strin
7979

8080
public override Task Init()
8181
{
82-
_client.Timeout = TimeSpan.FromSeconds(3);
82+
_client = new()
83+
{
84+
Timeout = TimeSpan.FromSeconds(3)
85+
};
8386

8487
AbstractTextBox newHostBox = (AbstractTextBox)OptionsUI![0];
8588
newHostBox.ValueChanged += OnHostChanged;

0 commit comments

Comments
 (0)