Sfoglia il codice sorgente

Avoid possible NRE.

drieseng 9 anni fa
parent
commit
68b2267103
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/Renci.SshNet/Channels/ChannelDirectTcpip.cs

+ 1 - 1
src/Renci.SshNet/Channels/ChannelDirectTcpip.cs

@@ -54,7 +54,7 @@ namespace Renci.SshNet.Channels
             _forwardedPort = forwardedPort;
             _forwardedPort.Closing += ForwardedPort_Closing;
 
-            var ep = socket.RemoteEndPoint as IPEndPoint;
+            var ep = (IPEndPoint) socket.RemoteEndPoint;
 
             // open channel
             SendMessage(new ChannelOpenMessage(LocalChannelNumber, LocalWindowSize, LocalPacketSize,