Explorar el Código

fix nil pointer handling in MemoryStreamConfig conversion.

Darien Raymond hace 7 años
padre
commit
3d3f0a96d6
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      transport/internet/memory_settings.go

+ 4 - 1
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() {