File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ import (
26
26
27
27
// UserAgent returns the user agent (mainly used by HTTP clients)
28
28
func UserAgent (settings * viper.Viper ) string {
29
- subComponent := settings .GetString ("network.user_agent_ext" )
29
+ subComponent := ""
30
+ if settings != nil {
31
+ subComponent = settings .GetString ("network.user_agent_ext" )
32
+ }
30
33
if subComponent != "" {
31
34
subComponent = " " + subComponent
32
35
}
@@ -41,7 +44,7 @@ func UserAgent(settings *viper.Viper) string {
41
44
42
45
// NetworkProxy returns the proxy configuration (mainly used by HTTP clients)
43
46
func NetworkProxy (settings * viper.Viper ) (* url.URL , error ) {
44
- if ! settings .IsSet ("network.proxy" ) {
47
+ if settings == nil || ! settings .IsSet ("network.proxy" ) {
45
48
return nil , nil
46
49
}
47
50
if proxyConfig := settings .GetString ("network.proxy" ); proxyConfig == "" {
You can’t perform that action at this time.
0 commit comments