mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-26 00:00:59 +00:00
fix: 解决应用安装 services 为空报系统错误的问题 (#5445)
This commit is contained in:
committed by
wanghe-fit2cloud
parent
1b07314c23
commit
dfd84d414e
@@ -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
|
||||
}
|
||||
|
||||
@@ -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{})
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user