From a8d32c4bb17c8754da97c50a55ad8accfeca0386 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <1paneldev@sina.com> Date: Tue, 25 Nov 2025 13:37:42 +0800 Subject: [PATCH] fix: Resolve application list display error caused by docker-compose.yml modifications --- agent/app/service/app_utils.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/agent/app/service/app_utils.go b/agent/app/service/app_utils.go index bf61073181c2..24fd8d818366 100644 --- a/agent/app/service/app_utils.go +++ b/agent/app/service/app_utils.go @@ -541,8 +541,18 @@ func handleUpgradeCompose(install model.AppInstall, detail model.AppDetail) (map if !ok || oldValue == nil { return nil, buserr.New("ErrFileParse") } - oldValueMap := oldValue.(map[string]interface{}) - oldServiceValue := oldValueMap[install.ServiceName].(map[string]interface{}) + oldValueMap, ok := oldValue.(map[string]interface{}) + if !ok { + return nil, buserr.New("ErrFileParse") + } + oldServiceValueInterface, ok := oldValueMap[install.ServiceName] + if !ok || oldServiceValueInterface == nil { + return nil, buserr.New("ErrFileParse") + } + oldServiceValue, ok := oldServiceValueInterface.(map[string]interface{}) + if !ok { + return nil, buserr.New("ErrFileParse") + } if oldServiceValue["deploy"] != nil { serviceValue["deploy"] = oldServiceValue["deploy"] }