File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ import (
2626
2727// UserAgent returns the user agent (mainly used by HTTP clients)
2828func 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+ }
3033 if subComponent != "" {
3134 subComponent = " " + subComponent
3235 }
@@ -41,7 +44,7 @@ func UserAgent(settings *viper.Viper) string {
4144
4245// NetworkProxy returns the proxy configuration (mainly used by HTTP clients)
4346func NetworkProxy (settings * viper.Viper ) (* url.URL , error ) {
44- if ! settings .IsSet ("network.proxy" ) {
47+ if settings == nil || ! settings .IsSet ("network.proxy" ) {
4548 return nil , nil
4649 }
4750 if proxyConfig := settings .GetString ("network.proxy" ); proxyConfig == "" {
You can’t perform that action at this time.
0 commit comments