Fix nil pointer exception when create config (#765)

The config stored in a wrong variable when has been generated a
new config
This commit is contained in:
Zoltan Papp 2023-03-27 15:37:58 +02:00 committed by GitHub
parent 71d24e59e6
commit 55ebf93815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ func (s *Server) Start() error {
// on failure we return error to retry
config, err := internal.UpdateConfig(s.latestConfigInput)
if errorStatus, ok := gstatus.FromError(err); ok && errorStatus.Code() == codes.NotFound {
config, err = internal.UpdateOrCreateConfig(s.latestConfigInput)
s.config, err = internal.UpdateOrCreateConfig(s.latestConfigInput)
if err != nil {
log.Warnf("unable to create configuration file: %v", err)
return err