fix: 解决应用安装 services 为空报系统错误的问题 (#5445)

pull/5448/head
zhengkunwang 2024-06-13 16:20:36 +08:00 committed by GitHub
parent 3b7f8c2724
commit 4209452e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -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{})

View File

@ -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
}