From 3d3f0a96d6512a602ed6cdc98962454b7a45b0f3 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 7 Sep 2018 14:56:42 +0200 Subject: [PATCH] fix nil pointer handling in MemoryStreamConfig conversion. --- transport/internet/memory_settings.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/internet/memory_settings.go b/transport/internet/memory_settings.go index 48d87feb4..dc7aa4017 100644 --- a/transport/internet/memory_settings.go +++ b/transport/internet/memory_settings.go @@ -17,7 +17,10 @@ func ToMemoryStreamConfig(s *StreamConfig) (*MemoryStreamConfig, error) { mss := &MemoryStreamConfig{ ProtocolName: s.GetEffectiveProtocol(), ProtocolSettings: ets, - SocketSettings: s.SocketSettings, + } + + if s != nil { + mss.SocketSettings = s.SocketSettings } if s != nil && s.HasSecuritySettings() {