We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2685af8 commit 18746aeCopy full SHA for 18746ae
1 file changed
Src/Xer.Messaginator.Extensions.MessageSources.Http/HttpMessageSource.cs
@@ -110,6 +110,11 @@ internal HttpMessageSource(string url,
110
.UseUrls(Url);
111
112
_host = ConfigureWebHost(webHostBuilder);
113
+
114
+ if (_host == null)
115
+ {
116
+ return Task.FromException(new InvalidOperationException("No web host was configured."));
117
+ }
118
119
return _host.StartAsync(cancellationToken);
120
}
@@ -121,7 +126,7 @@ internal HttpMessageSource(string url,
121
126
/// <returns>Asynchronous task.</returns>
122
127
public Task StopReceivingAsync(CancellationToken cancellationToken = default(CancellationToken))
123
128
{
124
- return _host.StopAsync(cancellationToken);
129
+ return _host?.StopAsync(cancellationToken);
125
130
131
132
#endregion IMessageSource<TMessage> Implementation
0 commit comments