Fix nil pointer interface assignment (#750)

This commit is contained in:
Jesse Peterson
2021-06-09 16:01:53 -07:00
committed by GitHub
parent 0ba759a5c1
commit bc8f82dc82
2 changed files with 5 additions and 1 deletions

View File

@@ -232,7 +232,6 @@ func serve(args []string) error {
ctx := context.Background()
httpLogger := log.With(logger, "transport", "http")
dc := sm.DEPClient
appDB := &appsbuiltin.Repo{Path: *flRepoPath}
scepEndpoints := scep.MakeServerEndpoints(sm.SCEPService)
@@ -296,6 +295,10 @@ func serve(args []string) error {
commandEndpoints := command.MakeServerEndpoints(sm.CommandService, basicAuthEndpointMiddleware)
command.RegisterHTTPHandlers(r, commandEndpoints, options...)
var dc depapi.DEPClient
if sm.DEPClient != nil {
dc = sm.DEPClient
}
depsvc := depapi.New(dc, sm.PubClient)
depsvc.Run()
depEndpoints := depapi.MakeServerEndpoints(depsvc, basicAuthEndpointMiddleware)