diff --git a/src/RestSharp/RestClient.Async.cs b/src/RestSharp/RestClient.Async.cs index 0a57d189f..24682b1ee 100644 --- a/src/RestSharp/RestClient.Async.cs +++ b/src/RestSharp/RestClient.Async.cs @@ -48,6 +48,11 @@ public async Task ExecuteAsync(RestRequest request, CancellationTo async Task ExecuteInternal(RestRequest request, CancellationToken cancellationToken) { Ensure.NotNull(request, nameof(request)); + // Make sure we are not disposed of when someone tries to call us! + if (_disposed) { + throw new ObjectDisposedException(nameof(RestClient)); + } + using var requestContent = new RequestContent(this, request); if (Authenticator != null) await Authenticator.Authenticate(this, request).ConfigureAwait(false);