Explorar el Código

check nil config

Darien Raymond hace 9 años
padre
commit
f488a63d97
Se han modificado 1 ficheros con 6 adiciones y 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
 }