check if cfg.Commons is nil

This commit is contained in:
Willy Kloucek
2022-05-16 09:32:12 +02:00
parent 382d91b22b
commit 97220e63e6
3 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell command -v go)
GO ?= $(shell which go)
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.

View File

@@ -53,7 +53,7 @@ func EnsureDefaults(cfg *config.Config) {
cfg.Tracing = &config.Tracing{}
}
if cfg.AdminUserID == "" {
if cfg.AdminUserID == "" && cfg.Commons != nil {
cfg.AdminUserID = cfg.Commons.AdminUserID
}
}

View File

@@ -97,7 +97,7 @@ func EnsureDefaults(cfg *config.Config) {
cfg.Metadata.SystemUserID = cfg.Commons.SystemUserID
}
if cfg.AdminUserID == "" {
if cfg.AdminUserID == "" && cfg.Commons != nil {
cfg.AdminUserID = cfg.Commons.AdminUserID
}
}