Fix NRE in WebLimitRequest()

This was possible if plugin triggered WebLimitRequest() for unrecognized service.
This commit is contained in:
Archi
2021-12-27 16:03:33 +01:00
parent 31bf21973b
commit ffccb98d79
2 changed files with 3 additions and 0 deletions

View File

@@ -69,6 +69,8 @@ public static class ASF {
[PublicAPI]
public static WebBrowser? WebBrowser { get; private set; }
internal static readonly SemaphoreSlim OpenConnectionsSemaphore = new(WebBrowser.MaxConnections, WebBrowser.MaxConnections);
internal static ICrossProcessSemaphore? ConfirmationsSemaphore { get; private set; }
internal static ICrossProcessSemaphore? GiftsSemaphore { get; private set; }
internal static ICrossProcessSemaphore? InventorySemaphore { get; private set; }

View File

@@ -1181,6 +1181,7 @@ public sealed class ArchiWebHandler : IDisposable {
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningUnknownValuePleaseReport, nameof(service), service));
limiters.RateLimitingSemaphore = ASF.RateLimitingSemaphore;
limiters.OpenConnectionsSemaphore = ASF.OpenConnectionsSemaphore;
}
// Sending a request opens a new connection