소스 검색

check nil config

Darien Raymond 9 년 전
부모
커밋
f488a63d97
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      transport/config.go

+ 6 - 1
transport/config.go

@@ -6,6 +6,11 @@ import (
 
 // Apply applies this Config.
 func (this *Config) Apply() error {
-	internet.ApplyGlobalNetworkSettings(this.NetworkSettings)
+	if this == nil {
+		return nil
+	}
+	if err := internet.ApplyGlobalNetworkSettings(this.NetworkSettings); err != nil {
+		return err
+	}
 	return nil
 }