Skip to content

Commit a8d32c4

Browse files
fix: Resolve application list display error caused by docker-compose.yml modifications
1 parent 48e2e01 commit a8d32c4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

agent/app/service/app_utils.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,18 @@ func handleUpgradeCompose(install model.AppInstall, detail model.AppDetail) (map
541541
if !ok || oldValue == nil {
542542
return nil, buserr.New("ErrFileParse")
543543
}
544-
oldValueMap := oldValue.(map[string]interface{})
545-
oldServiceValue := oldValueMap[install.ServiceName].(map[string]interface{})
544+
oldValueMap, ok := oldValue.(map[string]interface{})
545+
if !ok {
546+
return nil, buserr.New("ErrFileParse")
547+
}
548+
oldServiceValueInterface, ok := oldValueMap[install.ServiceName]
549+
if !ok || oldServiceValueInterface == nil {
550+
return nil, buserr.New("ErrFileParse")
551+
}
552+
oldServiceValue, ok := oldServiceValueInterface.(map[string]interface{})
553+
if !ok {
554+
return nil, buserr.New("ErrFileParse")
555+
}
546556
if oldServiceValue["deploy"] != nil {
547557
serviceValue["deploy"] = oldServiceValue["deploy"]
548558
}

0 commit comments

Comments
 (0)