azure: tag map can return nil (#3280)

Fixes #3193
This commit is contained in:
Frank Schröder 2017-07-16 14:29:43 -07:00 committed by James Phillips
parent 6cba31df99
commit de97fb0670

View file

@ -41,7 +41,8 @@ func (c *Config) discoverAzureHosts(logger *log.Logger) ([]string, error) {
for _, oneint := range *netres.Value {
// Make it a little more robust just in case there is actually no Tags
if oneint.Tags != nil {
if *(*oneint.Tags)[c.RetryJoinAzure.TagName] == c.RetryJoinAzure.TagValue {
tv := (*oneint.Tags)[c.RetryJoinAzure.TagName]
if tv != nil && *tv == c.RetryJoinAzure.TagValue {
// Make it a little more robust just in case IPConfigurations nil
if oneint.IPConfigurations != nil {
for _, onecfg := range *oneint.IPConfigurations {