소스 검색

fix nil pointer handling in MemoryStreamConfig conversion.

Darien Raymond 7 년 전
부모
커밋
3d3f0a96d6
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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() {