Explorar o código

check nil config

Darien Raymond %!s(int64=9) %!d(string=hai) anos
pai
achega
f488a63d97
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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
 }