File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Src/Xer.Messaginator.Extensions.MessageSources.Http Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ internal HttpMessageSource(string url,
110110 . UseUrls ( Url ) ;
111111
112112 _host = ConfigureWebHost ( webHostBuilder ) ;
113+
114+ if ( _host == null )
115+ {
116+ return Task . FromException ( new InvalidOperationException ( "No web host was configured." ) ) ;
117+ }
113118
114119 return _host . StartAsync ( cancellationToken ) ;
115120 }
@@ -121,7 +126,7 @@ internal HttpMessageSource(string url,
121126 /// <returns>Asynchronous task.</returns>
122127 public Task StopReceivingAsync ( CancellationToken cancellationToken = default ( CancellationToken ) )
123128 {
124- return _host . StopAsync ( cancellationToken ) ;
129+ return _host ? . StopAsync ( cancellationToken ) ;
125130 }
126131
127132 #endregion IMessageSource<TMessage> Implementation
You can’t perform that action at this time.
0 commit comments