diff --git a/backend/app/service/app.go b/backend/app/service/app.go index a9e903332..0f5e19d8e 100644 --- a/backend/app/service/app.go +++ b/backend/app/service/app.go @@ -367,7 +367,7 @@ func (a AppService) Install(ctx context.Context, req request.AppInstallCreate) ( } value, ok := composeMap["services"] - if !ok { + if !ok || value == nil { err = buserr.New(constant.ErrFileParse) return } diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index 526fef417..8afe96ff3 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -449,7 +449,7 @@ func getUpgradeCompose(install model.AppInstall, detail model.AppDetail) (string return "", err } value, ok := composeMap["services"] - if !ok { + if !ok || value == nil { return "", buserr.New(constant.ErrFileParse) } servicesMap := value.(map[string]interface{}) diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 9a45417e7..40ef2c20a 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -863,7 +863,7 @@ func changeServiceName(newComposeContent, newServiceName string) (composeByte [] return } value, ok := composeMap["services"] - if !ok { + if !ok || value == nil { err = buserr.New(constant.ErrFileParse) return }