aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar alecdwm 2016-04-08 13:12:52 +0200
committerGravatar alecdwm 2016-04-08 13:12:52 +0200
commita67103ebb2a6ac170a8087a37c491e97a0fa892b (patch)
tree6b4be4b609bac031800a7ebcc238950aebb41110
parent1ad5682f0f0a73b330335970d984b8df32e7de37 (diff)
fix nil access
-rw-r--r--rsham.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/rsham.go b/rsham.go
index 126e584..4f1670f 100644
--- a/rsham.go
+++ b/rsham.go
@@ -163,5 +163,9 @@ func sshHandleConnection(nConn net.Conn, config *ssh.ServerConfig) {
channel.Close()
}()
}
- sshLog.Info("Client Disconnected", "User", conn.User(), "RemoteAddr", nConn.RemoteAddr())
+ if conn != nil {
+ sshLog.Info("Client Disconnected", "User", conn.User(), "RemoteAddr", nConn.RemoteAddr())
+ } else {
+ sshLog.Info("Client Disconnected", "RemoteAddr", nConn.RemoteAddr())
+ }
}