From 57768cc328900b0fc8dcb009c839f728c5e1b5d6 Mon Sep 17 00:00:00 2001 From: Nicolas Zin Date: Wed, 9 Oct 2024 01:58:11 -0400 Subject: [PATCH] fix crash if we dont specify GOLIAC_SERVER_GIT_REPOSITORY --- internal/goliac_server.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/goliac_server.go b/internal/goliac_server.go index ca91cbc..582ed50 100644 --- a/internal/goliac_server.go +++ b/internal/goliac_server.go @@ -595,6 +595,13 @@ func (g *GoliacServerImpl) serveApply(forceresync bool) (error, bool) { repo := config.Config.ServerGitRepository branch := config.Config.ServerGitBranch + if repo == "" { + return fmt.Errorf("GOLIAC_SERVER_GIT_REPOSITORY env variable not set"), false + } + if branch == "" { + return fmt.Errorf("GOLIAC_SERVER_GIT_BRANCH env variable not set"), false + } + // we are ready (to give local state, and to sync with remote) g.ready = true