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

This commit is contained in:
zhengkunwang
2024-06-24 14:39:16 +08:00
committed by wanghe-fit2cloud
parent 1b07314c23
commit dfd84d414e
3 changed files with 3 additions and 3 deletions
+1 -1
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
}
+1 -1
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{})
+1 -1
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
}