@@ -512,23 +512,22 @@ or StatusCodes.BadNoCommunication
512512 try
513513 {
514514 ISession session ;
515- if ( transportChannel == null )
516- {
517- throw ServiceResultException . Unexpected (
518- "Transport channel is null for reverse connect session recreation." ) ;
519- }
520515 if ( m_reverseConnectManager != null )
521516 {
522517 ITransportWaitingConnection ? connection ;
523518 do
524519 {
525- EndpointDescription endpointDescription =
526- current . Endpoint ?? transportChannel . EndpointDescription ;
527-
520+ EndpointDescription ? endpointDescription =
521+ current . Endpoint ?? transportChannel ? . EndpointDescription ;
522+ if ( endpointDescription == null )
523+ {
524+ throw ServiceResultException . Unexpected (
525+ "EndpointDescription is null for reverse connect session recreation." ) ;
526+ }
528527 connection = await m_reverseConnectManager
529528 . WaitForConnectionAsync (
530529 new Uri ( endpointDescription . EndpointUrl ) ,
531- endpointDescription . Server . ApplicationUri )
530+ endpointDescription . Server ? . ApplicationUri )
532531 . ConfigureAwait ( false ) ;
533532
534533 if ( m_updateFromServer )
@@ -564,10 +563,13 @@ await endpoint
564563 . ConfigureAwait ( false ) ;
565564 m_updateFromServer = false ;
566565 }
567-
568- session = await current
569- . SessionFactory . RecreateAsync ( current , transportChannel )
570- . ConfigureAwait ( false ) ;
566+ session = transportChannel == null
567+ ? await current
568+ . SessionFactory . RecreateAsync ( current )
569+ . ConfigureAwait ( false )
570+ : await current
571+ . SessionFactory . RecreateAsync ( current , transportChannel )
572+ . ConfigureAwait ( false ) ;
571573 }
572574 // note: the template session is not connected at this point
573575 // and must be disposed by the owner
0 commit comments